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 |
How to achieve data abstraction?
How to use CRC Cards for Class Design?
What is the purpose of late binding in object-oriented programming?
Can constructors be parameterized?
Difference: 'uses', 'extends', 'includes'
7 Answers Cognizant, Protech, TY, University,
What are abstract methods?
What is polymorphism? When is it employed? give an example.
What is @functionalinterface?
What is the function of dynamic typing?
Can we override static methods? Why?
Write basic concepts of oops?
What is the use if instanceof keyword?