- 9
- 0
- 约 8页
- 2017-05-23 发布于河南
- 举报
S1阶段测试
一.选择题(每题2分,共40分)
1、给定下列代码:
if(x4){
System.out.println(Test 1);
}else if (x9){
System.out.println(Test 2);
}else {
System.out.println(Test 3);
}
要使输出为Test 2,则x的范围是:
A.x4 B.x4 C.x9 D.不存在
2、main()方法的返回类型是?
A. int B. void C. Boolean D. static E. Object
3、运行下列程序,输出为何?
public class Qd803 {
public static void main(String args[]) {
String word = restructure;
System.out.println(word.substring(2, 3));
}
}
A.est B.es C.str D.st E.s
4、代码System.out.println(+11+1); 的输出结果是:
A.(空) B.11 C.12 D.111
5、十进制数16的16进制表示格式是____。
A、0x10 B、0x16 C、0xA D、016
6、对于垃圾回收机制(Garbage Collection)的说明,下面哪个叙述是正确的?
A. 程序开发者必须编写线程来负责对内存空间的释放。
B. 垃圾回收机制会检查并释放那些不再需要使用的内存空间。
C. 垃圾回收机制允许程序开发者直接立即释放内存空间。
D. 垃圾回收机制可设定在预期的时间内释放被Java对象所使用的内存空间。
7、 有一个类(class)如下:
1. class Test {
2. void test(int i) {
3. System.out.println(“I am an int.”);
4. }
5. void test(String s) {
6. System.out.println(“I am a string.”);
7. }
8.
9. public static void main(String args[]) {
10. Test t=new Test();
11. char ch=y;
12. t.test(ch);
13. }
14. }
针对上述Test类,以下的叙述句中,哪个是正确的?
A. Line 5 will not compile, because void methods cannot be overridden.
B. Line 12 will not compile, because there is no version of test() that takes a char argument.
C. The code will compile but will throw an exception at line 12.
D. The code will compile and produce the following output: I am an int.
E. The code will compile and produce the following output: I am a String.
8、若要写出一个能将一组键(Key)与一组值(Value)结合的类,下述所列的接口(interface),哪个是最适用的?
A. Map B. Set C. SortedSet D. Collection
9、运行下列程序,其输出结果为何?
class Base {
int i;
Base() {
add(1);
}
void add
您可能关注的文档
- HTML默写标准文档(1.1).doc
- HY2BK配横向往重.doc
- i18n 笔记.ppt
- If_迈克尔·杰克逊的墓志铭.doc
- ie6,ie7,ie8,ff的最简单的css写法.doc
- IIS加固.doc
- Inside VCL-目录.doc
- Ipex+2010的印后加工.pdf
- IT操纵要点.doc
- IPMA人力资本开辟与治理试题.doc
- 《GB/T 46962-2026印刷技术 安全印刷过程管理》.pdf
- 中国国家标准 GB/T 46962-2026印刷技术 安全印刷过程管理.pdf
- GB/T 46962-2026印刷技术 安全印刷过程管理.pdf
- 中国国家标准 GB/T 32580.5-2026轨道交通 地面装置 高压交流开关设备及互感器 第5部分:27.5 kV和2×27.5 kV金属封闭开关设备和控制设备.pdf
- 《GB/T 32580.5-2026轨道交通 地面装置 高压交流开关设备及互感器 第5部分:27.5 kV和2×27.5 kV金属封闭开关设备和控制设备》.pdf
- GB/T 33248-2026印刷技术 胶印橡皮布.pdf
- GB/T 18282.6-2026医疗产品灭菌 化学指示物 第6部分:用于小型蒸汽灭菌器性能测试的二类指示物和过程挑战装置.pdf
- 中国国家标准 GB/T 18282.6-2026医疗产品灭菌 化学指示物 第6部分:用于小型蒸汽灭菌器性能测试的二类指示物和过程挑战装置.pdf
- 中国国家标准 GB/T 31308.1-2026行政、商业和行业中的数据元、过程和文档 长效签名 第1部分:CMS高级电子签名(CAdES)规范.pdf
- GB/T 31308.1-2026行政、商业和行业中的数据元、过程和文档 长效签名 第1部分:CMS高级电子签名(CAdES)规范.pdf
原创力文档

文档评论(0)