What is aggregation and composition ?

Answer Posted / balbir

Aggregation differs from ordinary composition in that it
does not imply ownership. In composition, when the owning
object is destroyed, so are the contained objects. In
aggregation, this is not necessarily true. For example, a
university owns various departments (e.g., chemistry), and
each department has a number of professors. If the
university closes, the departments will no longer exist,
but the professors in those departments will continue to
exist. Therefore, a University can be seen as a composition
of departments, whereas departments have an aggregation of
professors. In addition, a Professor could work in more
than one department, but a department could not be part of
more than one university

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is variable explain?

524


What is a byte string?

617


How to instantiate member inner class?

620


why we use merge option in hybernate pls give a ex snippet

1453


Why do we need array in java?

528






What are controls and their different types in awt?

596


What are the five major types of reference sources?

528


How to make a class or a bean serializable?

537


What is a native method in java programming?

523


how many types of Inheritance?

641


What is the requirement of thread in java?

613


What does the ‘static’ keyword mean? Is it possible to override private or static method in java?

561


Variable of the boolean type is automatically initialized as?

593


Explain the features of interfaces in java?

550


How an object is serialized in java?

522