Practical Meaning of Inheritance

What we mean by placing values into this hierarchy is that information we associate with abstraction categories higher in the diagram, for example Animals, are also applicable to categories lower in the diagram, such as Cats.

In a programming language, what a hierarchy tells us is that data areas and behavior defined in a parent class are also features we can associate with a child class. That is, they become part of the child class. In this fashion, data areas and behavior we associate with a child class are an extension of the data areas and behaviors of the parent.

On the other hand, just as a Cat is a more specialized type of object than is an indefinite Animal, a child class is a more specialized version of the parent class. Thus, a child class is both an extension as well as a restriction on the parent category.

[audio] [real] Text to accompany slide5, in Chapter 7 of An Introduction to Object-Oriented Programming