Could anyone please explain why this code throws an ambiguous overload error, surely the Integer method is more specific and applicable?
Thanks,
Ned
package object_orientation;
public class Ambiguous {
//ambiguous error compiler unsure whether boxing is needed or not
static void overload(Integer... d){
System.out.println("Integer");
}
static void overload(long... d){
System.out.println("Long");
}
public static void main(String a[]){
int i = 1;
overload(i);
}
}