public class TestClass {
private static void testMethod(){
System.out.println("testMethod");
}
public static void main(String[] args) {
((TestClass)null).testMethod();
}
}
A编译不通过
B编译通过,运行异常,报NullPointerException
C编译通过,运行异常,报IllegalArgumentException
D编译通过,运行异常,报NoSuchMethodException
E编译通过,运行异常,报Exception
F运行正常,输出testMethod
答案是什么,为什么呢 |
|