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
What is a friend function?
Explain about inheritance hierarchies?
What do you mean by "explicitly implemeting an interface". Give an example?
What are the main features of oops?
Explain about a class?
Why do we use oops concepts? What is its advantage?
Explain what a method is?
What is the use of interface?
Can you instantiate an abstract class and what is an inner class?
Can you give some examples of tokens?
What do you mean by abstract classes?
What's the main difference between arraylist / hashmap and vector / hashtable?
Can you explain primordial class loader?
What is a final variable?
What are base class, sub class and super class?