 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
We
can force application programs to always use pointers
|
|
|
to
base class objects instead of using pointers to derived
|
|
|
class
objects or using objects directly by making the
|
|
|
overridden
member functions protected or private in the
|
|
|
derived
classes.
|
|
|
| • |
This
is a way to force applications to adhere to the defined
|
|
|
interface
provided by the base class and to help ensure that
|
|
dynamic
binding will be used.
|
|
|
| • |
It
causes compilation errors to result if the application
|
|
|
attempts
to use static binding:
|
|
student* ps = &smith;
|
|
ps->statement(); //illegal access-protected member.
|
|
smith.statement(); //illegal
access-protected member.
|
|