Hi,everyone
in this program:
public class
Test {
public void method(Object o) {
System.out.println("Object Version");
}
public void method(
String s) {
System.out.println("String Version");
}
public static void main(String[] args) {
Test test = new Test();
Object o=new Object();
test.method(null);
}
}
I think the method use Object as argument should be invoked,but actually
the method use String as argument be invoked,how this happen?