Deferred Method in C++

Here is an example from C++. A parent class Shape defines various geometrical shapes. However, it cannot draw an image, since it does not know what type of shape it represents. Every subclass must redefine the draw method. Nevertheless, the concept of the draw method is associated with the parent class, not the child class.

[audio] [real] Text to accompany slide18, in Chapter 14 of An Introduction to Object-Oriented Programming