Gary Marshall wrote:
short --> Widen to int ==> select the " int doX(long... x)" method. (BTW: This is the method that is selected when the "int doX(Number n, Number m) " method is commented out).
Always remember that variable arguments is a new concept and to keep the old code in
java safe, the var- args are always chosen at last so here, boxing will be preferred
Widening Beats Boxing applies when they are used separately
see the following code
now look the following code
Widening beats boxing when there are two overloaded methods in which one has just Widening parameters and another has Boxing parameters
Hope this helps
hth
SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right