Chapter 12. Object-Oriented Programming: Inheritance
Say not you know another entirely, till you have divided an inheritance with him.
Johann Kasper Lavater
This method is to define as the number of a class the class of all classes similar to the given class.
Good as it is to inherit a library, it is better to collect one.
Save base authority from others' books.
In this chapter you will learn:
To create classes by inheriting from existing classes.
How inheritance promotes software reuse.
The notions of base classes and derived classes and the relationships between them.
The protected member access specifier.
The use of constructors and destructors in inheritance hierarchies.
The differences between public, protected and private inheritance.
The use of inheritance to customize existing software.
12.2 Base Classes and Derived Classes
12.3 protected Members
12.4 Relationship between Base Classes and Derived Classes
12.4.1 Creating and Using a CommissionEmployee Class
12.4.2 Creating a BasePlusCommissionEmployee Class Without Using Inheritance
12.4.3 Creating a CommissionEmployee-BasePlusCommissionEmployee Inheritance Hierarchy
12.4.4 CommissionEmployee-BasePlusCommissionEmployee Inheritance Hierarchy Using protected Data
12.4.5 CommissionEmployee-BasePlusCommissionEmployee Inheritance Hierarchy Using private Data
12.5 Constructors and Destructors in Derived Classes
12.6 public, protected and private Inheritance
12.7 Software Engineering with Inheritance
Answers to Self-Review Exercises