B.2, 1 C.1.82, 2 D.100, 82
21.执行下列程序段后,b, x, y 的值分别是多少? int x=6,y=8; boolean b;
b=x>y&&++x==--y; A.true, 6, 8 B.true, 7, 7 C.false, 6, 8 D.false, 7, 7
22.给出下面的代码:
if (x>10) { System.out.println(\
else if (x>0) { System.out.println(\ else { System.out.println(\x的取值在什么范围内时将打印字符串\ A.x > 10 | x < 0 B.x <= 10 & x > 0 C.x <=0 D.x > 0
23.结构化程序设计所规定的三种基本控制结构是哪一组? A.输入、处理、输出 B.树形、网形、环形 C.顺序、选择、循环 D.主程序、子程序、函数
24.下列语句序列执行后,k 的值是多少? int i=6, j=8, k=10, n=5, m=7; if( i A.9 B.10 C.11 D.12 25.以下选项中循环结构合法的是哪一个? A.while (int i<7) { i++; System.out.println(“i is “+i); } B.int j=3; while(j){ System.out.println(“ j is “+j); } C.int j=0; for(int k=0; j + k !=10; j++,k++){ System.out.println(“ j is “+ j + “k is”+ k); } D.int j=0; do{ System.out.println( “j is “+j++); if (j = = 3) {continue loop;} } while (j<10); 26.下面代码执行后,正确的输出结果是哪一个? public class Excmple{ public static void main(String args[] ){ int i=0; do{ System.out.println(\ } while(--i>0); System.out.println(\ } } A.Doing it for i is 0 B.Doing it for i is 1 C.Doing it for i is 2 D.Doing it for i is 3 27.以下是应用程序中定义的静态方法printBinary,若在其main方法中有方法调用语句printBinary(2),则输出的结果是哪个? static void printBinary(int i) { System.out.print(i + \的2进制数表示为:\ for (int j = 31; j >=0; j- -) if (((1 << j) & i) != 0) System.out.print(\ else System.out.print(\ System.out.println(); //换行 } A.00000000000000000000000000000000 B.00000000000000000000000000000001 C.00000000000000000000000000000010 D.00000000000000000000000000001111 28.执行以下程序,输出是什么? public class Test { void printValue(int m){ do { System.out.println(\ } while( - - m > 10) ; } public static void main(String args[]) { int i=10; Test t= new Test(); t.printValue(i); } } A.The value is 8 B.The value is 9 C.The value is 10 D.The value is 11 多选题:(共6道试题,每题2分) 1.Java开发包括下列哪几部分? A.Java2EE B.Java2ME C.Java2SE D.Java2CE 2.以下描述中哪些不是Java关键字? A.TRUE B.sizeof C.const D.super 3.在Java API文档中下面的哪些部分被包括在内? A.类及用途的描述 B.父类的方法的列表 C.成员变量的列表 D.类层次 4.变量\是一个boolean型的值,下面的哪些表达式是合法的? A.result = true; B.if ( result ) { ... } C.if ( result!= 0 ) {... } D.result = 1 5.下面哪些是合法的标识符 A.*point B.$persons C.TwoUsers D. _endline 6.给出下面的代码片断: 1) switch(m) 2) { case 0: System.out.println(\ 3) case 1: System.out.println(\ 4) case 2: 5) default: System.out.println(\ 6) } m为何值时输出值将会为“default”。 A.0 B.1 C.2 D.3 判断题:(共9道试题,每题2分) 1.调用System.gc()方法不能保证JVM立即进行垃圾收集,而只能是建议。 正确 错误 2.类加载器加载程序运行所需要的所有类,它通过区分本机文件系统的类和网络系统导入的类增加安全性。 正确 错误 3.Java数组的长度只在构造(创建)数组时指定,而在声明数组时不能指定。 正确 错误 4.main()方法前的public修饰符、static修饰符均是必须的。 正确 百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库电大 Java语言和WWW技术 阶段测验答案(2)在线全文阅读。
相关推荐: