Composition

In this lesson, you'll learn how to achieve composition in Java.

We'll cover the following...

Composition is the practice of creating other class objects in your class. In such a scenario, the class which creates the object of the other class is known as the owner and is responsible for the lifetime of that object.

Composition relationships are Part-of ...