ublic class Demo7 {
public void nullMethod(Object obj) {
System.err.println("object");
}
public void nullMethod(String str) {
System.err.println("string");
}
public static void main(String[] args) { O
Demo7 t = new Demo7();
t.nullMethod(null);
}
}
/*
疑问:
程序是如何执行的?
1、 System.err 这里是打印什么来的?
2、 null 值匹配的对象类型?
3、 注释调用第一个nullMethod 运行查看结果?
4、 解读以下程序:
String str = null;
for(int i = 0; i < 5; i++){
str+=i;
}
*/
|