← Quiz: Object Relationships: all 10 questions
Quiz: Object Relationships · Question 6 of 10
Which question best decides between aggregation and composition?
Which question best decides between aggregation and composition?
- A.Does the class have more than one method?
- B.If the whole is deleted, do the parts still make sense on their own?
- C.Is the class public?
- D.Does the class use inheritance?
Answer & explanation
Correct answer: If the whole is deleted, do the parts still make sense on their own?
The difference is ownership and lifetime of the parts.
Can you get the rest right without peeking?
Take the timed Quiz: Object Relationships quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →