L16-Polymorphism 3 27 PDF
L16-Polymorphism 3 27 PDF
MULTIPLE INHERITANCE
POLYMORPHISM IN C++
WHAT IS POLYMORPHISM?
• If you have decided that a class must be abstract, then you should make each
function that must be overridden pure virtual
• Pointers to a base class may be assigned the address of a derived class object.
• When you write a class with a destructor, and that class could
potentially become a base class, you should always declare the
destructor virtual
• the derived class has its own destructor, it will not execute when the
object is destroyed or goes out of scope
REFERENCES
• D & D Chapter 12
• GADDIS Chapter 15