public class Test { public void f1() { } } public class Pargoam2 { public static void main(String[] args) { Test t1; t1.f(); } } 运行Program2的main方法时,会发生java.lang.NullPointerException
B.
public class Test { public void f1() { } } public class Pargoam2 { public static void main(String[] args) { Test t1; t1.f(); } } 运行Program2的main方法时,不会发生java.lang.NullPointerException