Polymorphism is a feature of OOPs that allows the object to behave differently in different conditions.
In C++ we have two types of polymorphism:
- Compile time Polymorphism – This is also known as static (or early) binding.
- Runtime Polymorphism – This is also known as dynamic (or late) binding.
Compile time polymorphism example is function overloading and operator overloading.
Runtime Polymorphism It is achieved using function overriding in which the base class function is a virtual function .