I want to know whether the below example is function overloading,
int display(int,int);
char display(char,char);
Printable View
I want to know whether the below example is function overloading,
int display(int,int);
char display(char,char);
Yes..
The above example is an example of overloading.
But in java,we will call it as method overloading and in C++,it is function overloading..
Thanks
Neelima
[QUOTE=neelim;10259]Yes..
The above example is an example of overloading.
But in java,we will call it as method overloading and in C++,it is function overloading..
Thanks
Neelima[/QUOTE]
Thanks neelima
Yes...of course its a function overloading...
ya, it's method overloading
same method name difference in parameters is methodoverloading
function overloading in c++ we call it as a method overloading in java
[QUOTE=vicky19772003;10256]I want to know whether the below example is function overloading,
int display(int,int);
char display(char,char);[/QUOTE]
int display(int,int);
Char display(int,int);
char display(char,char);
int display(char,char);
char display(int,char);
char display(char,int); etc.
all are correct and can exist.
[QUOTE=vicky19772003;10256]I want to know whether the below example is function overloading,
int display(int,int);
char display(char,char);[/QUOTE]
This is an eg. of function overloadin since the function names are same & arguments are different.The return types may or may not be the same.Don't get confused with function overriding since that is related with inheritance.