Inheritance is bad because
Wheel
andTortilla
should not both inherit fromCircle
.– David Reid
One very common problem with class inheritance, of course, is that you don't get anything so clean as Tortilla
and Wheel
inheriting from Circle
. Generally in a large, real-world project, you get Circle
inheriting from both Tortilla
and Wheel
, because you already had a Tortilla
and a Wheel
at the time you discovered you needed a Circle
, and it was so much easier to just do that for now.
So now all Circle
s have numberOfSpokes
and also cornOrFlour
attributes.