Unit 4 Quiz Flashcards

1
Q

Inheritance implements a _______ relationship?

A

Is-a

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

When classes are related where one class defines common features for other classs, this type of class forms a(n) ________?

A

Inheritance hierarchy

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

A _______ class refers to any of the classes below a particular class in an inheritance hierarchy?

A

Descendent

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

Inheritance allows you to re-use code that was written for another context.

A

True

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

When deciding on the relationship between two classes it is extremely hard to determine if you should use inheritance or composition.

T or F

A

False

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

Aggregation and composition both implement a ______ relationship?

A

has-a

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

What modifier do you use to prevent a class from having any subclasses?

A

final

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

When a subclass has a method with the same name, the same sequence of parameter types, and the same return type as a method in a superclass, this is called:

A

Method Overriding

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

Global stuff takes precedence over local stuff.

T or F

A

False

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

You can access an overridden method by prefixing the common method name with _____ and then a dot.

A

super

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