What is aggregation and composition ?
Answer / 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 |
What is an abstract class and abstract method?
How to display all the prime numbers between 1 and n (n is the number, get the input from user)
Can you use this() and super() both in a constructor?
Can anonymous class have constructor?
What problems will occur when you don?t use layout managers?
What is the purpose of interface?
How do you stop a thread in java?
What is bubble sorting in java?
To the class members how can we provide security?
What are passing parameters?
How many decimal places is a double?
What is constructor chaining and how is it achieved in java?