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
What are Classes and Objects?
What is single and multiple inheritance?
Can a class implement two interfaces having default method with same name and signature?
Differentiate between overloading and overriding.
Can an interface implement or extend another interface?
Can we override static methods? Why?
How can I be thrown polymorphically?
Can an interface have an inner class?
What is sealed modifiers?
Explain static binding
What are all the operators that cannot be overloaded?
Can we override static methods of a class?
What are the methods required to create changes in subclasses?
What is the difference between multiple and multilevel inheritance?
What is the practical implementation of inner classes?