"relient" <
[email protected]> a écrit dans le message de (e-mail address removed)...
| Hi, I have three classes: Animal, Dog and Cat. Dog inherits from Animal
| and Cat inherits from Dog. My question is: is Cat now also a Animal
| even though it didn't inherit directly from Animal?
Inheritance implies an "is a" relationship. By inheriting Dog from Animal,
you are saying that a Dog "is" an Animal. Inheriting Cat from Dog means that
a Cat "is" a Dog, which "is" also an Animal.
Apart from the fact that a Cat isn't really a Dog shouldn't spoil the
illusion

)
Seriously though, You would correctly inherit both Cat and Dog from Animal
and then you could inherit from Dog to give you different breeds like
Alsatian, Spaniel, etc.
Joanna