public class P {
String m(int i) {
return "P.m(int)";
}
String m(Object o) {
return "P.m(Object)";
}
}
public class Test {
public static void main(String[] args) {
P p = new P();
System.out.println(p.m(Integer.valueOf(42)));
}
}
I can't understand why this program prints "P.m(Object)" instead of "P.m(int)".