Interviews7 answers
Different Types of Polymorphism
7 Answers
Static polymorphism example:function overloading,function overriding,constructor overloading.
Dynamic polymorphism example : virtual function
Neha KumariPosted Nov 5, 2017, 8:43 AM EST
Polymorphism is mainly 2 type : 1) Run Time 2) Compile Time
Ashish SrivastavaPosted Apr 22, 2016, 9:36 AM EDT
Polymorphism is mainly 2 type :
1) Run Time polymorphism:
a) Virtual function
2) Compile Time Polymorphism :
a) function overloading
b) operator overloading
Compile time polymorphism is used for Function overloading
Runtime is used for implementing virtual functions,overriding etc
Rahul PrajapatPosted Jun 10, 2015, 6:27 PM EDT
http://www.catonmat.net/blog/cpp-polymorphism/
Munesh SharmaPosted Feb 14, 2015, 12:13 AM EST
http://www.aspdotnet-suresh.com/2013/09/polymorphism-in-c-with-example-types-of-polymorphism.html
Munesh SharmaPosted Feb 14, 2015, 12:13 AM EST
Polymorphis
--------------------
Polymorphism means ability to take more than one form.
Polymorphism is mainly divided into :
1) Run Time polymorphism:
a) Virtual function
2) Compile Time Polymorphism :
a) function overloading
b) operator overloading
Compile time polymorphism is used for Function overloading
Runtime is used for implementing virtual functions,overriding etc
Overloading: is an example of compile time polymorphism.(Because the function to call is decide at compile time)
example:
Math math=Math();
math.add(10,20)
math.add(10,20,30)
Overriding: an example of compile time polymorphism.(Because the function to call is decide at runtime)
example:
superclassObject.add(10,10)
subclassObject.add(10,10)
Here in the case of Overriding the method which will call is decide will decide at the runtime.
ponveniPosted Sep 12, 2013, 3:21 AM EDT
- OverLoading
- OverRiding
Pavan RamamurthyPosted Aug 20, 2013, 11:34 PM EDT



