We have a class Animal
and another class, Rectangle
. Should one of these classes inherit from the other?
Animal
should inherit from Rectangle
Rectangle
should inherit from Animal
We only use inheritance with classes that have common features. Animal
and Rectangle
have nothing in common.