44.8k views
5 votes
In _________ relationship between 2 classes, the parts of a class have the same lifespan as their owner, and the parts cannot be involved in another com- position.

a. aggregation
b. dependency
c. composition
d. association

1 Answer

3 votes

Final answer:

In a composition relationship between two classes, the parts are strongly dependent on the owner class and cannot be part of another composition; they share the same lifespan.

Step-by-step explanation:

In a composition relationship between two classes, the parts of a class have the same lifespan as their owner, and the parts cannot be involved in another composition. This means that the composed objects are entirely dependent on the owner object. If the owner object is destroyed, so are the composed parts. It signifies a strong form of aggregation where the part cannot exist independently of the whole.

User Majid Roustaei
by
8.3k points

No related questions found