posted 16 years ago
Your assumption is right.....If you want a more detailed answer read the next few lines.
byte is autoboxed to Byte.
In the code there is no method with a Byte,Byte argument.
A "Byte" cannot be autoboxed to an "Integer" since they(these Wrapper Classes) are different from each other. Remember that the following classes extend "Number" class:
AtomicInteger, AtomicLong, BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, Short. Therefore, a "Byte" is a "Number" and hence the output "Method1".
[ July 06, 2007: Message edited by: Veeraraagavan Rajachandrasekhar ]