 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
student
smith("Joe Smith", 5000, "UT");
|
|
student
s(smith); s.statement();
|
|
|
checking
c; c = s; c.statement();
|
|
|
account
a; a = s; a.statement();
|
|
|
| • |
When
a student object is initialized/assigned to a
|
|
|
checking
or account object, we lose the derived parts.
|
|
| • |
When
we use the statement member function, the
|
|
|
function
used is based on the type of the object.
|
|
| • |
For
the checking object, the checking's statement member
|
|
function
is used. For the account object, the account's
|
|
|
statement
member function is used.
|
|
| • |
These
are statically bound by the compiler based on the
|
|
|
type
of the object.
|
|