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


Please Help Members By Posting Answers For Below Questions

What are the various types of constructors?

608


Why dynamic binding is used in object-oriented programming?

605


Can we override static methods? Why?

508


Is it possible to override private virtual methods?

537


What is static polymorphism?

683






What are the basic concepts of oop?

542


What does it mean that a method or class is abstract?

516


When will you use an interface and abstract class?

571


How many methods are there in the serializable interface?

545


Write basic concepts of oops?

560


Explain colloboration

511


Is it possible to provide method implementations in java interfaces? If possible, how do we provide them?

520


How a program can be structured using the concept of object oriented programming?

550


What are a base class, subclass, and superclass?

559


What is the main advantage of using inheritance?

566