overloading with both widening and boxing

public void add(long... x){}
public void add(Integer... x){}

add(2);

this produces error...why overlaoding is not performed with both widening and boxing?

but overloading without vararg works fine

public void add(long x){}
    public void add(Integer x){}

    add(2);

here add(long x) will be executed that is widening beats boxing...why not same concept with var arguments

5
задан jzd 7 February 2011 в 13:08
поделиться