 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
An
abstract class is a class that can only be derived from;
|
|
|
no
objects can be instantiated it.
|
|
|
| • |
Its
purpose is to define an interface and provide a common
|
|
base
class for derived classes.
|
|
|
| • |
A
base class becomes an abstract class by making its
|
|
|
constructor(s)
protected or by declaring a virtual function
|
|
|
pure: virtual void statement()=0;
|
|
|
| • |
Derived
classes must implement all pure virtual functions.
|
|
|
If a
derived class does not implement these functions, then
|
|
|
it
becomes an abstract class as well.
|
|
|
| • |
Abstract
classes are not required to implement their pure
|
|
|
virtual
functions.
|
|