Hello,
I'm preparing for
SCJP 5 and have doubt about overloading methods.
I tried to compile this code:
public class Main {
public static void
test(int... a){System.out.println("int array");}
public static void test(Number... a){System.out.println("Number");}
public static void main(
String[] args) {
test(new byte[]{2,3});
}
}
and i got compile time error: cannot find symbol: method test(byte[])
I expected that the result would be:int array. Can someone explain me why is this happened.
Nancy