.

Polymorphism in C++

Polymorphism means ability of the message to be displayed in more than one form. A person may have different characteristics at the same time. So the same person possess different behavior in different situation. This is one of the important features of object oriented programming.

There are two types of polymorphism. They are

Compile time polymorphism

Runtime Polymorphism

Virtual Function

A virtual function is a function present in the base classNamewhich is declared using the keyword virtual. In other words signals to the compiler want static linkage for this function. Based on the kind of the object it is referred to as dynamic linkage or dynamic binding.

Example

.