Method overloading is a type of polymorphism. It makes no sense to have a different return type, since the method signature would be completely different.
Overloading is perfectly fine to use, as long as the methods are semantically equivalent. Basically you don't want the overloaded method to do a subtraction, with one version doing addition.
e.g.,
don't do this:
Code
public int sum(int a, int b){
return a+b;
}
public double sum(double a, double b){
return a-b;
}
This post was edited by Klexmoo on Aug 29 2018 05:34am