If an object contains another object and the contained can’t exist without the existence of that particular object, then it’s known as the composition. In simple words, the composition is a kind of aggregation used to describe the reference between two classes using the reference variable.
For example, a class student contains another class named address. So, if the class address cannot exist without the class student, then there exists a composition between them.