home *** CD-ROM | disk | FTP | other *** search
- You can think of the traffic signal in this example as a piece of
- client code. You can think of the different kinds of traffic as
- objects of classes that are all derived from the same base class.
- Just as the traffic signal sends the same message to all three
- kinds of traffic, the client code in a C++ program that uses
- polymorphism treats objects from different derived classes as if
- they were objects of the base class. And just as the different
- kinds of traffic react in their own individual ways to the traffic
- signal, the objects of derived classes react individually to
- function calls from the client code.
-