🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Object Relationships: all 10 questions

Quiz: Object Relationships · Question 7 of 10

A House constructor creates its own Room objects and no other object holds them. Which relationship is this?

A House constructor creates its own Room objects and no other object holds them. Which relationship is this?

  1. A.Association
  2. B.Aggregation
  3. C.Inheritance
  4. D.Composition
Answer & explanation

Correct answer: Composition

The whole creates and owns the parts, and they go when the house goes.

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 →