I want to know how to determine the composition and aggregation code in java. I have C ++ code, but I don't understand how to write in java.
Structure
class A {};
class B { A composited_A; };
Pointer Aggregation
class A {};
class B
{
A* pointer_to_A;
B(A anA){
pointer_to_A = &anA;
}
Can someone tell me how both work in JAVA. (I know what is meant by composition and aggregation)};
Mifas source
share