Microsoft Visual C++ .NET(c) Step by Step

Before you start writing any code to use inheritance in C++, you should spend some time designing the inheritance hierarchy. Identify classes that have common behavior, and consider whether these classes would benefit from using inheritance.

In this chapter, you will define and implement an inheritance hierarchy representing different types of bank accounts. The following illustration shows how the classes will be arranged in the inheritance hierarchy.

Note

This illustration uses Unified Modeling Language (UML) notation to represent inheritance. Each box in this diagram is a class. The arrow pointing to BankAccount denotes inheritance in UML.

You will define and implement all these classes during this chapter. Let’s begin with the base class, BankAccount.

Категории