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

Quiz: UML Class Diagrams · Question 6 of 10

House ◆—— Room (filled diamond at House). Which Java design matches?

House ◆—— Room (filled diamond at House). Which Java design matches?

  1. A.Rooms are created elsewhere and passed to the house
  2. B.The House creates its Room objects itself, and they are not shared
  3. C.Room extends House
  4. D.House is a parameter of a Room method only
Answer & explanation

Correct answer: The House creates its Room objects itself, and they are not shared

A filled diamond is composition: the whole owns and creates its parts.

Can you get the rest right without peeking?

Take the timed Quiz: UML Class Diagrams quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →