Let’s pause for a moment and review what we’ve got.
We learned that objects provide a service for us and we don’t need to know how they do it.
We know how to subclass [inherit from] other classes.
We know that a pointer to the parent class can point to any child class, so a routine dealing with the parent class will deal with any child class.
We learned that we can make new objects “on the fly” with the new operator. This is one of the keys to a very flexible program.
We saw that modifications/additions to existing code (the addition of a ‘cone” object) can be kept local; no other code needs to be changed as a result of the addition.