Differentiate between Aggregation and containment?
Answer Posted / arul
Aggregation is the relationship between the whole and a
part. We can add/subtract some properties in the part
(slave) side. It won?t affect the whole part.
Best example is Car, which contains the wheels and some
extra parts. Even though the parts are not there we can
call it as car.
But, in the case of containment the whole part is affected
when the part within that got affected. The human body is
an apt example for this relationship. When the whole body
dies the parts (heart etc) are died.
| Is This Answer Correct ? | 33 Yes | 7 No |
Post New Answer View All Answers
Does java support multiple inheritance? if not, what is the solution?
Can we override a method by using same method name and arguments but different return types?
What is garbage collection(gc)?
How can I be thrown polymorphically?
What is a static method? Why do we need static methods in java 8 interfaces?
What is virtual?
What is a final variable?
what is virtual function and pure virtual function ?
What is difference between class and interface?
What is the difference between new and override?
What are the four important foundation concepts of OOP ?
What is the benefit of Composition over Inheritance?
Can you create an instance of an interface?
Explain what a method is?
What is Abstract method and how different from Virtual Method?