previous | start | next

1.2 Inheritance

This is a more complicated way of using an existing class to help create a new one.

The new class declares that it "inherits" from the existing class and automatically gets all the data and function members.

The definition of the new class does NOT repeat these inherited declaraions.

The new class CAN add additional data and/or function members.

The class type defined by the new class is compatible with the existing type. It is just more specialized since it may have extra data and function members.

The new type is said to be a "kind of" the type it inherits from.

The new class is called the "derived" class. The existing class is called a "base" class.



previous | start | next