A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

[size=1em]
public class TestClass {
   private static void testMethod(){
        System.out.println("testMethod");
   }
   public static void main(String[] args) {
        ((TestClass)null).testMethod();
   }
}



  • 编译不通过
  • 编译通过,运行异常,报NullPointerException
  • 编译通过,运行异常,报IllegalArgumentException
  • 编译通过,运行异常,报NoSuchMethodException
  • 编译通过,运行异常,报Exception
  • 运行正常,输出testMethod

[url=]查看正确选项[/url]


0 个回复

您需要登录后才可以回帖 登录 | 加入黑马