Tuesday 17 January 2017

Can we overload methods that differ only by static keyword?

We cannot overload two methods in Java if they differ only by static keyword (number of parameters and types of parameters is same).


Output: Compiler Error, cannot redefine foo().


1 comment: