OOP & Design Patterns - Composition vs Inheritance - Favour Composition, Why & When
Consider a class hierarchy where a base class Animal has subclasses Dog and Bird. If you want to add a new behavior 'canFly' only to Bird, what happens if you use inheritance to add this behavior in the base class?
