Skip to main content

Polymorphism :

 C++ have oops concepts. In these concepts c++ have polymorphism principle. Polymorphism means Poly = Many, Morphism = Forms. Means ability of a message to be displayed in different forms/more than one form. Polymorphism have two types:  

👉  Compile Time Polymorphism 

👉  Run Time Polymorphism

Compile Time polymorphism have different two types: 1. Function overloading, 2.operator overloading. Let's discuss about Function overloading. 

In Function overloading type polymorphism there are multiple functions with same name but different arguments then these functions can be called overloaded. Functions can be overloaded through change in number of arguments and change in type of arguments. Let's take an example for better understanding:

 In above example we have func() named two functions with difference of number of arguments and type of arguments. Here we said to be func() is overloaded function.


Comments