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. Overloading, Hiding, and Overriding
6.5. Constructors, Destructors, and Copy Assignment Operators
6.6. Processing Command-Line Arguments
6.6.1. Derivation and ArgumentList
6.6.2. Exercises: Processing Command-Line Arguments
6.7. Containers
6.8. Managed Containers, Composites and Aggregates
6.8.1. Exercises: Managed Containers, Composites and Aggregates
6.9. Containers of Pointers
6.9.1. Exercises: Containers of Pointers
6.10. 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.