May 2012
Intermediate to advanced
679 pages
16h 56m
English
Earlier, we have stated that polymorphism means different behaviour by different objects for the function with same name. The function can be in the base class or in the derived class. When compiler decide which function to call at the time of compilation (strictly speaking before execution of program starts), it is termed as compile time polymorphism.
We will illustrate this with Programs 13.1 and 13.2.
Program: Write a program to study polymorphism. Use the following specifications: Create a base class called creatures. It should have a constructor and method move to tell about how that creature moves. The data member should be a character array for storing the name of ...
Read now
Unlock full access