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


Please Help Members By Posting Answers For Below Questions

Explain about a class in oop?

735


What is the difference between aggregation and composition?

694


Can an interface have an inner class?

787


What is the order of call of constructors in inheritiance?

780


What is a functional interface? What is sam interface?

729


Explain what you understand by function overloading.

738


What is static polymorphism?

863


Can we access interface static method using interface references?

740


What does the keyword virtual represented in the method definition?

818


Why do we use oops concepts? What is its advantage?

736


What is the main advantage of using inheritance?

756


What is the super keyword?

778


What is Abstract method and how different from Virtual Method?

681


Explain the use of Vtable and what are the various problems to override the functions?

706


Explain the implementation phase with respect to oop?

714