33、试图编译和运行以下代码的结果是: class Base { private Base() { System.out.println(0); } public Base(int i) { System.out.println(i); } } public class Test extends Base { public Test() { super(1); }; public static void main(String argv[]){ Test t = new Test(); } }

A.因为构造方法不能是private的所以不能编译 B.由于Test的父类的构造器是私有的所以Test不能编译 C.通过编译,打印出0 D.通过编译,打印出1

时间:2024-06-04 15:01:29

相似题目