Difference and connection between aggregation and combination in JAVA, and difference between java aggregation and combination
From JAVA programming-basics (8th)
Definition: one object can contain another object. The relationship between these two objects is called composition ).
A combination is actually a special form of clustering. Clustering simulates a (has-a) relationship, indicating the ownership relationship between two objects. The owner object in the ownership relationship is called the aggregation object, and its class is called the aggregating class ). The subordinate object in the attribution relationship is called the aggregated object, and its class is called the aggregated class ).
An object can be owned by several other clustering objects. If an object belongs to only one clustered object, the relationship between it and the clustered object is called composition ). For example, "one student has a name" and "one student has an address" is a clustering relationship because one address can be shared by several students.
In UML, solid diamond represents a combination, and hollow diamond represents a clustering relationship.
Clustering is usually represented as a data field in the clustering class,
Clustering can also exist between multiple objects in the same class. For example, a person may have one or more managers. One manager can be represented by variables, and multiple managers can use arrays,
Here, the relationship between aggregation and combination is self-evident.