public static void main(String[] args) {
System.out.println(fun(2,3,4));
}
static int fun(int a,int b,int c)
{
return 1;
}
static int
If you test this expressions:
System.out.println(fun(2,3,4));
System.out.println(fun(2,3));
System.out.println(fun(2,3,4,7));
The output is
1
0
0
The Java compiler first checks for a method whose declaration matchs the exact parameters of the invocation, and otherwise, it searches for the alternative method matching.