public class Boxing9 {
public static void main(
String[] args) {
int i = 10;
method(i);
}
static void method(Object o){
System.out.println("Object called");
}
static void method(Number n){
System.out.println("Number called");
}
}
what will be answer, after boxing of primitive 'i' to Integer i. it should get widen. Since Integer is a Number and also Integer is a Object.
Which method will be called?