adspace


What is the benefit of Composition over Inheritance?

Answer Posted / Vinay Vishal

Composition offers better modularity, flexibility, and extensibility because it allows creating objects with specific behavior without inheriting unwanted properties from other classes. With inheritance, you are forced to use methods that may not be useful or appropriate for your specific needs.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category