0
If in a program their are two function which share same number of arguments ,then function overloading work ?
2 Answers
+ 3
At least in java you overload methods with different parameters
It shares same number of arguments however they differ in data type.
void myFun(int x) {}
void myFun(double x){}
void myFun(double x, int y) {}
+ 3
Overloading works when there are two functions with same name but-
1) differ in argument types
2) differ in number of arguments
You cannot overload a function just by changing the return type.