21.4 Pure Virtual Member Functions
- abstract class: contains a pure virtual method
- Provides an i/f, but no behavior
- Cannot be instantiated
- Used only as a base class for inheritance
- E.g., compute the area of a shape:
- Shape must declare an area method
- Can't define it
- Each derived class has an area method
- interface - class where all methods are pure virtual
prev
|top
|next