12.8. Wrap-Up
This chapter introduced
inheritance—the ability to create a class by absorbing an existing class's data
members and member functions and embellishing them with new capabilities.
Through a series of examples using an employee inheritance hierarchy, you
learned the notions of base classes and derived classes and used
public inheritance to create a derived class
that inherits members from a base class. The chapter introduced the access
specifier protected—derived-class member functions
can access protected base-class members. You
learned how to access redefined base-class members by qualifying their names
with the base-class name and binary scope resolution operator (::). You also saw the order in which constructors and
destructors are called for objects of classes that are part of an inheritance
hierarchy. Finally, we explained the three types of inheritance—public,
protected and private—and the
accessibility of base-class members in a derived class when using each type.
In Chapter
13, Object-Oriented Programming: Polymorphism,
we build on our discussion of inheritance by introducing polymorphism—an
object-oriented concept that enables us to write programs that handle, in a more
general manner, objects of a wide variety of classes related by inheritance.
After studying Chapter
13, you'll be familiar with classes, objects,
encapsulation, inheritance and polymorphism—the essential concepts of
object-oriented programming.