Top News

Why it is not possible to do method overloading by changing return type of method in java?

 

If we change the return type of overloaded methods then it will lead
to ambiguous behavior. How will clients know which method will
return what type. Due to this different return type are not allowed in
overloaded methods.

Post a Comment

Previous Post Next Post