Prev Up Next
Go backward to 10/26/2001   Exam Answer Key Is Released
Go up to News Archive
Go forward to 10/18/2001   Practice Exam Answer Key Is Released

10/19/2001   How Inheritance and Dynamic Binding Support Subtype Polymorphism

 AP Wire Service
As was discussed earlier (see Chapter 2 in the BGL book), there are two major approaches to polymorphism in programming: parametric polymorphism and subtype polymorphism. C++ supports parametric polymorphism with templates and subtype polymorphism with class inheritance and dynamic binding of virtual member functions. Chapter 13 of Accelerated C++ is a thorough discussion of the mechanisms and uses of subtype polymorphism. The authors develop an example base class called Core and a derived class called Grad, for processing student records consisting of names and grades. Again, the issues of proper definition of constructors, assignment operators, and destructors come into play, in addition to the new issues of inheritance and virtual functions.

 

Prev Up Next