 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
By
defining a class that is based on another class, using
|
|
|
inheritance,
one class is a specialization of another.
|
|
|
| • |
Such
a class is said to be a derived class.
|
|
|
| • |
The
class it is derived from is a base class.
|
|
|
| • |
The
derived class inherits the base class' members.
|
|
|
| • |
The
benefit of this type of relationship is that it allows
|
|
|
reuse
of existing code from the base class and allows us
|
|
|
to
focus on the new or specialized behavior in the derived
|
|
class.
|
|
|
| • |
An
existing program should not be aware that a new
|
|
|
derived
class has been created if the specialized
|
|
|
relationship
is properly defined and encapsulated.
|
|