Can someone please explain aggregation in java .??
If a class have an entity reference, it is known as Aggregation. Aggregation represents HAS-A relationship.
Address address; //Address is a class
Aggregation achieved when there's need to explain HAS-A relation..for example employee has a address , student has a details..
Aggregation can accessed from other class through method or constructor..
Aggrigation is whole-part relationship in oops one class dependnce on onther i.e object as well
In this relationship, even thought one object is a part of the other, each object can maintain its own meaning independently if the relationship is lost, its weak relationship and has no life cycle responsibilities.
Aggregation means has a relation ship , if a class contain the reference of another class is called a aggregation , it can be usse at the place of inheritence when the class do not extended a class
A)10 This type of question was asked several times in my exams..It is 10 due to post increment of x(x++).
Creating objects of one class inside another class is known as aggregation....