北京语言大学14春《JAVA语言程序设计》作业2
14春《JAVA语言程序设计》作业2
试卷总分:100 奥鹏学习网(aopeng123.cn) 发布
单选题
一、单选题(共 10 道试题,共 100 分。)
V
1. 下面哪些语句在编译时不会出现错误或警告?
A. float f=1.3;
B. byte b=275;
C. boolean=null;
D. int i=10;
此题选: D 满分:10 分
2. 下列程序段输出的结果是_______。public class NewClass { public static void main(String args[]){ int x=0; boolean b1,b2,b3,b4; b1=b2=b3=b4=true; x=(b1 b2 b3^b4)?++x:x--; System.out.printl
A. -1
B. 0
C. 1
D. 2
需要购买答案的联系QQ:79691519满分:10 分
3. 下面程序段的输出结果是_______。public class Test{ public static void main(String args[]){ int a,b; for(a=1,b=1;a =100;a++){ if(b =10)break; if(b%2==1){ b+=2; continue; } } Syste
A. 5
B. 6
C. 7
D. 101
需要购买答案的联系QQ:79691519满分:10 分
4. 下列程序运行后,输出的结果是_______。public class Test{ public static void main(String args[]){ outer:for(int i=0;i 3;i++) inner:for(int j=0;j 2;j++){ if(j==1)continue outer; System.out.println(j+" and "+i); }
A. 0 and 0 0 and 1 0 and 2
B. 0 and 1 0 and 1 0 and 2
C. 1 and 0 1 and 1 1 and 2
D. 0 and 0 1 and 1 2 and 2
需要购买答案的联系QQ:79691519满分:10 分
5. 下列选项是常量的是_______。
A. true
B. int
C. f
D. 10+a
需要购买答案的联系QQ:79691519满分:10 分
6. char变量的取值范围是_______。
A. 0~32767
B. 0~65535
C. -256~255
D. -32768~32767
需要购买答案的联系QQ:79691519满分:10 分
7. 执行下列程序段,请选出正确的答案。public class Test{ public static void throwit(){ throw new RuntimeException(); } public static void main(String args[]){ try{ System.out.println("你好吗"); throwit(); System.out.pri
A. 不能通过编译
B. 输出“你好吗”→RuntimeException异常发生→输出“出错!”→输出“结束”
C. 输出“你好吗”→RuntimeException异常发生→输出“结束”
D. 输出“你好吗”→输出“结束”→RuntimeException异常发生
此题选: D 满分:10 分
8. 下面程序段的输出结果是_______。public class NewClass { public static void main(String args[]){ int a[]=new int[11]; int p[]=new int[4]; int k=5; for(int i=1;i =10;i++) a=i;
A. 37
B. 31
C. 33
D. 35
需要购买答案的联系QQ:79691519满分:10 分
9. 执行以下语句后b的值为int a=1,b=10; do{ b=b-a; a++; }while(b-- 0);
A. 9
B. -2
C. -1
D. 8
此题选: D 满分:10 分
10. 下列循环的次数是_______。int y=2,x=4; while(--x!=x/y){}
A. 1次
B. 2次
C. 3次
D. 4次
需要购买答案的联系QQ:79691519满分:10 分
试卷总分:100 奥鹏学习网(aopeng123.cn) 发布
单选题
一、单选题(共 10 道试题,共 100 分。)
V
1. 下面哪些语句在编译时不会出现错误或警告?
A. float f=1.3;
B. byte b=275;
C. boolean=null;
D. int i=10;
此题选: D 满分:10 分
2. 下列程序段输出的结果是_______。public class NewClass { public static void main(String args[]){ int x=0; boolean b1,b2,b3,b4; b1=b2=b3=b4=true; x=(b1 b2 b3^b4)?++x:x--; System.out.printl
A. -1
B. 0
C. 1
D. 2
需要购买答案的联系QQ:79691519满分:10 分
3. 下面程序段的输出结果是_______。public class Test{ public static void main(String args[]){ int a,b; for(a=1,b=1;a =100;a++){ if(b =10)break; if(b%2==1){ b+=2; continue; } } Syste
A. 5
B. 6
C. 7
D. 101
需要购买答案的联系QQ:79691519满分:10 分
4. 下列程序运行后,输出的结果是_______。public class Test{ public static void main(String args[]){ outer:for(int i=0;i 3;i++) inner:for(int j=0;j 2;j++){ if(j==1)continue outer; System.out.println(j+" and "+i); }
A. 0 and 0 0 and 1 0 and 2
B. 0 and 1 0 and 1 0 and 2
C. 1 and 0 1 and 1 1 and 2
D. 0 and 0 1 and 1 2 and 2
需要购买答案的联系QQ:79691519满分:10 分
5. 下列选项是常量的是_______。
A. true
B. int
C. f
D. 10+a
需要购买答案的联系QQ:79691519满分:10 分
6. char变量的取值范围是_______。
A. 0~32767
B. 0~65535
C. -256~255
D. -32768~32767
需要购买答案的联系QQ:79691519满分:10 分
7. 执行下列程序段,请选出正确的答案。public class Test{ public static void throwit(){ throw new RuntimeException(); } public static void main(String args[]){ try{ System.out.println("你好吗"); throwit(); System.out.pri
A. 不能通过编译
B. 输出“你好吗”→RuntimeException异常发生→输出“出错!”→输出“结束”
C. 输出“你好吗”→RuntimeException异常发生→输出“结束”
D. 输出“你好吗”→输出“结束”→RuntimeException异常发生
此题选: D 满分:10 分
8. 下面程序段的输出结果是_______。public class NewClass { public static void main(String args[]){ int a[]=new int[11]; int p[]=new int[4]; int k=5; for(int i=1;i =10;i++) a=i;
A. 37
B. 31
C. 33
D. 35
需要购买答案的联系QQ:79691519满分:10 分
9. 执行以下语句后b的值为int a=1,b=10; do{ b=b-a; a++; }while(b-- 0);
A. 9
B. -2
C. -1
D. 8
此题选: D 满分:10 分
10. 下列循环的次数是_______。int y=2,x=4; while(--x!=x/y){}
A. 1次
B. 2次
C. 3次
D. 4次
需要购买答案的联系QQ:79691519满分:10 分
版权声明
声明:有的资源均来自网络转载,版权归原作者所有,如有侵犯到您的权益
请联系本站我们将配合处理!
下一篇 : 北京语言大学14春《综合英语》(IV)作业2