Association, composition, aggregation in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Association, composition, aggregation in java

Is there any special keyword or piece of code used for aggregation composition and Association like we use extends for inheritance?

20th Jan 2022, 11:18 AM
Dany Fentom
Dany Fentom - avatar
1 Answer
+ 1
No, because as code it can be same and it depends in context. If I speculate about it, aggregation is closer to reference types and there is usually keyword 'new'. Or generic <> diamond can be there composition might be more with 'final' keyword but these are not rules
21st Jan 2022, 12:01 AM
zemiak