Object-Oriented Programming Flashcards
1
Q
content
A
- classes and interfaces
- objects with attributes and methods
2
Q
object
A
functional unit
3
Q
Advantages of OO Programming
A
- improved software-development productivity
- improved software maintainability
- faster development
- lower cost of development
- higher-quality software
4
Q
Disadvantages of OO Programming
A
- steep learning curve
- larger program size
- slower programs
- not suitable for all kinds of programs
5
Q
instantiate an object
A
e.g.
Bicycle bike1 = new Bicycle();
6
Q
class definition
A
- data fields (attributes)
- constructor
- methods
7
Q
Inheritance
A
- reuse of existing classes when creating a new class
- derived class will inherit public operations defined in the base class
8
Q
child class
A
- inherit public operations of parent class
- may override certain attributes or methods
- only specefies what is different to parent class
9
Q
Access Control Attribute Keywords
A
private -> protected -> no modifier -> public
10
Q
Encapsulation
A
- put data and operations on this data private
- user does not need to know the implementation details
- ability to access and modify the data through public operations -> setters and getters
11
Q
Polymorphism
A
- different objects respond to the same message in different ways
- 1 method with different implementations
- often in subclasses
12
Q
Interface
A
- combination of all public methods and properties of an object
- set of specifications you can always count on - a “contract”
13
Q
Definining and Implementing Interfaces
A
- can’t be instantiated
- no constructors
- all methods are abstract
- cannot contain instance fields
- contains only both static and final declared fields
- not extended by a class, but implemented by a class.
- can extend multiple interfaces