CS FundamentalsHardGATE CS · TCS NQT Prime · Product Company SDE

In a UML class diagram, a solid diamond at one end of an association line represents:

  1. A. Generalisation (inheritance)
  2. B. A dependency that exists only at compile time
  3. C. Simple association with no ownership implied at all
  4. D. Composition: the 'part' object's lifetime is bound to the 'whole', and cannot exist independently of it

Correct answer: D. Composition: the 'part' object's lifetime is bound to the 'whole', and cannot exist independently of it

A filled (solid) diamond denotes composition, a strong whole-part relationship where the part's lifecycle is tied to the whole (e.g. a House and its Rooms); an empty diamond instead denotes the weaker aggregation relationship.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic