 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Using
this account class hierarchy, whenever we need an
|
|
|
account
object we can use a checking, student, or savings
|
|
object
in its place.
|
|
|
| • |
This
is because every checking, student, and savings
|
|
|
object
contains an account object.
|
|
|
| • |
This
is the essential characteristic of a hierarchy.
|
|
|
| • |
Notice
that it does not work the other way around.
|
|
|
| • |
We
cannot use an account object when we need a
|
|
|
checking,
student, or savings object because an account
|
|
|
object
does not have the necessary data members or
|
|
|
member
functions.
|
|
|
| • |
If we
attempt to do that a compile error will result.
|
|