Chapter 6.  Inheritance and Polymorphism

Table of Contents

6.1. Simple Derivation
6.1.1. Inheritance Client Code Example
6.1.2. Exercises: Simple Derivation
6.2. Derivation with Polymorphism
6.2.1. Exercises: Derivation with Polymorphism
6.3. Derivation from an Abstract Base Class
6.4. Inheritance Design
6.5. Overloading, Hiding, and Overriding
6.6. Constructors, Destructors, and Copy Assignment Operators
6.7. Processing Command-Line Arguments
6.7.1. Derivation and ArgumentList
6.7.2. Exercises: Processing Command-Line Arguments
6.8. Containers
6.9. Managed Containers, Composites and Aggregates
6.9.1. Exercises: Managed Containers, Composites and Aggregates
6.10. Containers of Pointers
6.10.1. Exercises: Containers of Pointers
6.11. Review Questions

[ fromfile: inheritance-intro.xml id: inheritance-intro ]

Abstract

This chapter introduces the concepts and shows some examples of how to define inheritance relationships between C++ classes. Overriding methods, the virtual keyword, and simple examples show how polymorphism works.