Multiple choice technology programming languages

Which is/are true?

  1. 'Composition' and 'Aggregation' both are 'association'.

  2. 'Composition' is a stronger form of 'Aggregation'.

  3. 'Aggregation' is a stronger form of 'Composition'.

  4. A 'Composition' adds a lifetime responsibility to 'Aggregation'.

Reveal answer Fill a bubble to check yourself
A,B,D Correct answer
Explanation

Composition and Aggregation are both types of association relationships between objects. Composition is a stronger form of aggregation where the child object cannot exist independently of the parent (lifetime responsibility - if parent is destroyed, child is destroyed). Aggregation is weaker - the child can exist independently (has-a relationship without ownership).