试题详情
- 单项选择题 1. public class Target { 2. private int i = 0; 3. public int addOne() { 4. return ++i; 5. } 6. } And: 1. public class Client { 2. public static void main(String[] args) { 3. System.out.println(new Target().addOne()); 4. } 5. } Which change can you make to Target without affecting Client?()
A、 Line 4 of class Target can be changed to return i++;
B、 Line 2 of class Target can be changed to private int i = 1;
C、 Line 3 of class Target can be changed to private int addOne() {
D、 Line 2 of class Target can be changed to private Integer i = 0;
- D
关注下方微信公众号,在线模考后查看
热门试题
- 1.public class Test
- 如何将字符串转换为数值?()
- 下面哪些方法禁止子类重定义该方法()
- Given this&ens
- 什么是静态初始化器?它有什么特点?与构造
- 在linux编程中,以下哪个TCP的套接
- What is th
- What will&ensp
- class TestApp{
- Given that&ensp
- 下列哪些访问修饰符是在子类中可见的?()
- If…else结构控制当条件满足和不满足
- Which the two&
- 10. interface&
- 建立单选框需要哪些步骤?()
- 1. public&ensp
- Which pathQ
- 下面有关java threadlocal
- JAVA反射机制主要提供了以下哪些功能(
- 包含抽象方法的类必须声明为抽象类