class A {
public void a1(Object o) {
System.out.println("1");
}
public void a1(String o) {
System.out.println("2");
}
public A() {
}
}
public class Test1 {
public static void main(String[] args) {
A a = new A();
a.a1(null);
}
}
运行结果:
2
谁能帮我分析分析,为什么结果是2?