OOPS Interview Questions · Question 09

Why is composition often preferred over inheritance?

Interview preparation resource from Gate Smashers.

Understand it clearly

Give an example.