Autoboxing vs. widening quiz
Posted by staufferjames on December 18, 2007 at 10:59 AM EST
Does widening or autoboxing happen first? Which param method will be called from the autoboxing method? If one param method is commented out then it will have no problem calling the other.
private static void autoboxing() {
Integer integer = new Integer(2);
param(integer);
}
private static void param(int param) {
System.out.println("param(int " + param + ")");
}
private static void param(Object param) {
System.out.println("param(Object " + param + ")");
} Related Topics >>
Blog Links >>
- Login or register to post comments
- Printer-friendly version
- staufferjames's blog
- 661 reads





