#6 inheritance + cmsc131 review Flashcards
(5 cards)
1
Q
object class
A
super class of all classes
2
Q
2 methods of the object class
A
equals()
toString()
3
Q
what does default toString() do?
A
returns the address of the object
4
Q
composition
A
a class contains another object as a field (has_a relationship) generally favor composition to inheritance (a car has_a engine)
5
Q
interface
A
> hold non-implemented method signatures
can have default and static methods
classes that implement an interface must implement all of its methods
what can a reference of an interface refer to?