Why method overloading not possible changing return type Java

Why method overloading not possible changing return type Java

Answer : return type of the method does not matter and when you compile class compiler matches method name if overloaded method name is same then compiler uses the method parameter to detect which overloaded method to refer.

Leave a Reply

Your email address will not be published. Required fields are marked *