0 votes
in JAVA by
What is composition?

1 Answer

0 votes
by

Holding the reference of a class within some other class is known as composition. When an object contains the other object, if the contained object cannot exist without the existence of container object, then it is called composition. In other words, we can say that composition is the particular case of aggregation which represents a stronger relationship between two objects. Example: A class contains students. A student cannot exist without a class. There exists composition between class and students.

Related questions

0 votes
asked Oct 28, 2023 in JavaScript by DavidAnderson
0 votes
asked Aug 30, 2020 in Python by sharadyadav1986
...