What do you mean by aggregation?

1 votes
112 views
Siris Jain asked 14-Nov-2017 in programming by Siris Jain

What do you mean by aggregation?

1 Answer

0 votes
Arti Mishra answered 13-Jul-2018 by Arti Mishra

"Aggregation in Java "

 In Java Aggregation, represent a relationship between two classes that are used to describe the “has-a" relationship between objects. It is a more flexible and advanced version of the association. It contains the address of another class and each class is considered as a part of the aggregation class.
And the reusability of code is achieved by aggregation if there is no “is-a” relationship.
Aggregation represents a relationship where the child can exist independently of the parent class. For Example, if you create a class (parent) and the second class is a child, and delete the class parent then the child exists.
Aggregation implies a relationship where the child can exist independently of the parent. Example: Class (parent) and Student (child). Delete the Class and the Students still exist.