When do you prefer to use composition than aggregation?
Answer Posted / naveen sisupalan
Composition is a stronger form of aggregation. If you are
sure that the life of the part is managed entirely by the
whole then you can go for composition. Without whole, the
part can't exist also.
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
Define a good interface?
What's the main difference between arraylist / hashmap and vector / hashtable?
How do I make sure that an object is released in code such as a connection or file object?
What is the benefit of Composition over Inheritance?
What are the properties that are defined in an object model?
Is @functionalinterface annotation mandatory to define a functional interface? What is the use of @functionalinterface annotation? Why do we need functional interfaces in java?
What is the default access modifier in a class?
Explain method overriding.
What are the features of encapsulation ?
What is operator overloading?
What are a base class, subclass, and superclass?
What is the significance of encapsulation?
What do you mean by abstract classes?
Do we require a parameter for constructors?
Explain about abstraction?