#6 inheritance + cmsc131 review Flashcards

(5 cards)

1
Q

object class

A

super class of all classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

2 methods of the object class

A

equals()

toString()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what does default toString() do?

A

returns the address of the object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly