I was making some changes to the above code as below:
class Eggs {
int doX(Long x, Long y) { return 1; }
int doX(int... x) { return 2; }
int doX(Integer x, Integer y) { return 3; }
//int doX(Number n, Number m) { return 4; }
public static void main(
String[] args) {
new Eggs().go();
}
void go() {
short s = 7;
System.out.print(doX(s,s) + " ");
System.out.println(doX(7,7));
} }
In the above code i was expecting the result as : 3 , 3 (as per the low prioirity of var-args)
but the result is : 2 , 3
Bob can you explain how the priority decides in this case
Thanks