You can not overload the function by differing only their return type.
You can only overload the function in the following ways
- Parameter types
- Number of parameters
- Order of the parameters declared in the method
You can not come to know which function is actually called (if it was possible).
One more thing I would like to add is
function overloading is providing a function with the same name, but with a different signature. but the return type of a method is not considered as a part of the method's signature.
So this is another way to understand why method overloading can't be done only by return type.