试题详情
- 单项选择题 class ClassA { public int numberOfinstances; protected ClassA(int numberOfinstances) { this.numberOflnstances = numberOfinstances; } } public class ExtendedA extends ClassA { private ExtendedA(int numberOfinstances) { super(numberOflnstances); } public static void main(String[] args) { ExtendedA ext = new ExtendedA(420); System.out.print(ext.numberOflnstances); } } Which is true?()
A、 420 is the output.
B、 An exception is thrown at runtime.
C、 All constructors must be declared public.
D、 Constructors CANNOT use the private modifier.
E、 Constructors CANNOT use the protected modifier.
- A
关注下方微信公众号,在线模考后查看
热门试题
- Your web
- 求三位数中,个位数字与十位数字之和除以1
- 以下关于java文件名的叙述,正确的有?
- 根据整型参数m的值,计算公式t=1-1/
- 有一个n*m的矩阵,编写程序,找出其中最
- Which fourQ
- 用于编译Java源文件的JDK工具是()
- 方法中定义的内部类是否可以存取方法中的局
- What is th
- 设计一个圆类,将圆的位置(圆心坐标和半径
- 以下可以正确获取结果集的有()。
- 创建线程的时候必须实现哪项接口?()
- Which two
- public class&e
- 下面哪些类型属于引用类型()
- 在Swing中,如何建立工具栏?()
- class Test4&en
- 1. public&ensp
- 输出9*9口诀。
- 求1~200之间勾股数的组数(如a*a+