Has-A Relationship

Back to Composition vs Inheritance

An object contains a reference to another object as a member field, rather than inheriting from it. The containing object delegates behavior to the contained object, enabling flexible combinations of functionality.

property composition has-a