Explain the mechanism of composition?



Explain the mechanism of composition?..

Answer / Abhishek Rajput

Composition is a technique in OOP that involves creating an object (composite) from other smaller, pre-existing objects (components). Instead of inheriting properties and behaviors, the composite object will have a reference to its components. This provides more flexibility than inheritance as it allows for multiple types of components within a single composite object.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOAD Interview Questions

How to achieve data abstraction?

1 Answers  


How to use CRC Cards for Class Design?

2 Answers   Protech,


What is the purpose of late binding in object-oriented programming?

1 Answers  


Can constructors be parameterized?

1 Answers  


Difference: 'uses', 'extends', 'includes'

7 Answers   Cognizant, Protech, TY, University,


What are abstract methods?

1 Answers  


What is polymorphism? When is it employed? give an example.

1 Answers   iNautix,


What is @functionalinterface?

1 Answers  


What is the function of dynamic typing?

1 Answers  


Can we override static methods? Why?

1 Answers  


Write basic concepts of oops?

1 Answers  


What is the use if instanceof keyword?

1 Answers  


Categories