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
Write a note on encapsulation?
Differentiate between a class and a method.
Define Destructor?
What is difference between class and interface?
Explain the purpose of composition.
Explain about a class in oop?
What is difference between static and non-static fields of a class?
What is the difference between abstract & interface?
What are the four important foundation concepts of OOP ?
How does abstraction differ from encapsulation.
Describe the Diamond problem. Where does this problem occur?
Do we require parameter for constructors?
How do you prevent a class from being inherited by another class?
Does a class inherit the constructor of its super class?
What is composition? Explain the purpose of composition.