Asked by
Hritik Gupta
on Oct 27, 2024Verified
Composition is a "has-a" relationship.
Composition
In object-oriented programming, composition is a design principle where a class references one or more objects of other classes in instance variables, thus representing a "has-a" relationship.
"Has-a" Relationship
In object-oriented programming, it indicates that an object of one class contains or encapsulates objects of another class.
- Understand the principles of "is-a" and "has-a" relationships within object-oriented programming.
Verified Answer
MB
Learning Objectives
- Understand the principles of "is-a" and "has-a" relationships within object-oriented programming.