If you have ArrayList<Integer> and you want to use the remove method
that takes the Integer reference rather than the int value, how do you
do it so that the compiler knows which version you are wanting?
Lawman
hlwangz - 26 Apr 2006 03:33 GMT
ArrayList contains a method: public boolean remove(Object o)
hlwangz - 26 Apr 2006 03:34 GMT
ArrayList contains a method: public boolean remove(Object o)
Mike Schilling - 26 Apr 2006 03:49 GMT
> If you have ArrayList<Integer> and you want to use the remove method
> that takes the Integer reference rather than the int value, how do you
> do it so that the compiler knows which version you are wanting?
Pass the Integer; autoboxing won't occur (that is, the call won't be
ambiguous.)