- 0
- 0
- 约7.46千字
- 约 8页
- 2018-03-14 发布于河南
- 举报
J2SE 知识点巩固提高题
J2SE 知识点巩固提高题
Question 1
Click the Exhibit button.
1. public class A {
2.
3. static int counter = 0;
4.
5. public static int getInstanceCount() {
6. return counter;
7. }
8.
9. public A() {
10. ++counter;
11. }
12.
13. }
Given this code from Class B:
25.A a1 =new A();
26. A a2 =new A();
27. A a3 =new A();
28. System.out.printIn(A.getInstanceCount() );
What is the result?
A. Compilation of class A fails.
B. Line 28 prints the value 3 to System.out.
C. Line 28 prints the value 1 to System.out.
D. A runtime error occurs when line 25 executes.
E. Compilation fails because of an error on line 28.
Q
您可能关注的文档
最近下载
- 二年级标点符号的使用.docx VIP
- 急性前葡萄膜炎多学科决策模式中国专家共识(2025版).docx
- 中央空调采购安装投标方案(技术方案).docx
- fluent中的heat-release-rate-概述说明以及解释.doc VIP
- 华东理工大学新编日语教程4第7课.ppt VIP
- 新编日语教程4-课件-第5课.ppt VIP
- 惠州学院高等数学()期末试题参考答案.doc VIP
- GB 45673- 2025《危险化学品企业安全生产标准化通用规范》之“5.2安全生产责任制”专业解读与应用(编制-2025A0).docx VIP
- 【主编叶凡】大学物理(上+下)课后作业答案.doc VIP
- 陪诊师免责服务协议.pdf VIP
原创力文档

文档评论(0)