Asked by Maddy Kimble on Sep 27, 2024

Composition indicates a/an _______________ relationship.

A) Is-a
B) Has-a
C) both A & B
D) none of the above

Composition

In programming, the concept of building classes whose instances are derived from other classes not through inheritance but by including them as instance variables.

Is-a

The "Is-a" relationship in object-oriented programming describes an inheritance connection where a child class is a more specific instance of a parent class.

Has-a

A relationship in object-oriented programming where one class contains a reference to another, indicating a posession or usage relationship.

  • Distinguish between composition and inheritance and their respective relationships in object-oriented programming.