Polymorphism in C+
Polymorphism is a feature of OOPs that allows the object to behave differently in different conditions.
-> polymorphism as the ability of a message to be displayed in more than one form.
Real life example of polymorphism, A person at the same time can have different characteristic. Like a man at the same time is a father, a husband, an employee. So the same person posses different behavior in different situations. This is called polymorphism.
*Polymorphism is considered as one of the important features of Object Oriented Programming.
In C++ we have two types of polymorphism:
1) Compile time Polymorphism – This is also known as static (or early) binding.
2) Runtime Polymorphism – This is also known as dynamic (or late) binding.
Function overloading and Operator overloading are perfect example of Compile time polymorphism.