
- Forum
- Programming Talk
- C and C++
- Overloading and polymorphism - Are they same
Overloading and polymorphism - Are they same
This is a discussion on Overloading and polymorphism - Are they same within the C and C++ forums, part of the Programming Talk category; Hi All, Polymorphism is a certain item appearing in different forms or ways. That is making a function or operator ...
-
Overloading and polymorphism - Are they same
Hi All,
Polymorphism is a certain item appearing in different forms or ways. That is making a function or operator to act in different forms. I wanted to know whether Overloading and polymorphism refer to same technology. If not what is the difference between the two?
Regards,
Allan
-
Overloading is a kind of Polymorphism. The first difference to state is in terms of syntax of appearance of overloaded functions and polymorphic functions. Overloaded functions have structure and calling method just like normal function calls. Polymorphic functions require the use of a dot operator.
-
12-25-2010, 08:14 AM #3
- Join Date
- Dec 2010
- Answers
- 32
no overloading and polymorphism is not a same thing.....
overloading is a process of loading a function or operator in a method on the other hand polymorphism is a process of using a same function in different way. Return type and name of the function should be same////for example
int add(int,float);
int add(int,int);
float add(int,int);
first two will work as a polymorphism,because the return type and name is same...when we will enter int and float,1st function will be called and when we will enter two integer value 2nd function will be called..
for third function new calling line got to declare in the main as because the return type is different...
-
Sponsored Ads

Reply With Quote





