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
Why to use nested classes in java? (Or) what is the purpose of nested class in java?
How do you reverse a list?
Do extraneous variables affect validity?
When parseint method can be used?
What is ternary operator?
What is java oops?
What is the functionality of the stub?
What's the difference between int and integer in java?
What is derived datatype?
What is difference between char array and string?
What is better - 'bit-shift a value' or 'multiply by 2'?
What is constructor and its types?
Can java run on google chrome?
Does sprintf allocate memory?
What is constant in programming?