Benefits of using Composition: Composition allows us to reuse the code . In Java, we can use multiple Inheritance by using the composition concept. The Composition provides better test-ability of a class. Composition allows us to easily replace the composed class implementation with a better and improved version.
Read moreWhat is difference between aggregation and composition in Java?
Aggregation implies a relationship where the child can exist independently of the parent . For example, Bank and Employee, delete the Bank and the Employee still exist. whereas Composition implies a relationship where the child cannot exist independent of the parent.
Read moreWhat is aggregation in Oops Mcq?
Explanation: Aggregation occurs when objects have their own life cycle and child object can associate with only one parent object .
Read moreWhat is aggregation in Oops Mcq?
Explanation: Aggregation occurs when objects have their own life cycle and child object can associate with only one parent object .
Read moreWhat is aggregation with example in DBMS?
In aggregation, relationship with its corresponding entities is aggregated into a higher level entity . For example: Center entity offers the Course entity act as a single entity in the relationship which is in a relationship with another entity visitor.
Read moreWhat is aggregation with example in DBMS?
In aggregation, relationship with its corresponding entities is aggregated into a higher level entity . For example: Center entity offers the Course entity act as a single entity in the relationship which is in a relationship with another entity visitor.
Read moreWhat is an aggregation and give example on aggregation?
Aggregation is a term which is used to refer one way relationship between two objects . For example, Student class can have reference of Address class but vice versa does not make sense.
Read more