Java Composition Flashcards

1
Q

What is composition?

A

It is where you include several classes as part of a larger class, but not using extends or interfaces. It is a has a relationship and not a Is A relationship.

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

What is one key point to remember with composition?

A

Can include an object as a variable of another object. Imagine a laptop that includes several other objects and compose the object.

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