anyone can explain composition in java with example? | Sololearn: Learn to code for FREE!

0

anyone can explain composition in java with example?

4/22/2020 5:33:03 AM

Kuldeep rathod

2 Answers

New Answer

+5

For example: A car has a engine, a window has a button, a zoo has a tiger. Composition is a special case of aggregation. In other words, a restricted aggregation is called composition. When an object contains the other object and the contained object cannot exist without the other object, then it is called composition.

+2

Please refrain from copying your thread title into the tags. Tags are search terms, use of irrelevant words in tags will ruin accuracy of search facility.