OOPs supports two different types of Polymorphism as below:
1. Static Binding (or Compile time) Polymorphism
2. Dynamic Binding (or Runtime) Polymorphism
Static Binding or Compile time polymorphism
This polymorphism type uses method overloading or function overloading. Certain conditions are conducive for static polymorphism as below:
* Parameter types should be different.
* The sequence of parameters can be different.
* A number of parameters for one method should be different from another method.
* The matching type and number of arguments of static polymorphism invoke the overloaded functions.
* Dynamic Binding or Runtime polymorphism
* This polymorphism type uses method overriding. Through pointers and virtual functions, we can achieve overriding.
* When a derived class has a definition for one of the base class’s member functions, that base class is method overridden.
Posted Date:- 2021-09-30 00:29:17