当我执行下面的代码时,我得到以下输出:
带有字符串参数的方法称为 ..."
为什么?
public class StringObjectPOC {
public static void test(Object o) {
System.out.println("Method with Object argument Called ...");
}
public static void test(String str){
System.out.println("Method with String argument Called ...");
}
public static void main(String[] args) {
StringObjectPOC.test(null);
}
}