奥鹏易百

 找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

帮助中心知识拓展客服QQ 515224986
查看: 536|回复: 0

北语20春《Java语言程序设计》作业1

[复制链接]

1万

主题

2

回帖

2万

积分

论坛元老

积分
29240
发表于 2020-4-29 09:00:09 | 显示全部楼层 |阅读模式
扫码加微信
试卷名称20春《Java语言程序设计》作业1
1.下面程序段的输出结果是_______。publicclassTest{publicstaticvoidmain(Stringargs[]){intxyx=(int)Math.sqrt(5)/2+(int)Math.random()*5/2y=(int)Math.sqrt(3)/2+(int)Math.random()*3/2if(xy)System.out.println(&quotxy&quot)
北京语言大学
在线作业
A.xy
B.x=y
C.xy
D.编译错误
答案
2.下列程序段不正确的是_______。
A.StringA=&quotfirstJava&quotA=&quotJava&quot
B.StringA=&quotfirstJava&quotA+=&quotJava&quot    奥鹏作业答案请联系QQ515224986
C.IntegerJ=newInteger(27)J=7
D.IntegerJ=newInteger(27)J
答案
3.下面程序段的输出结果为_______。publicclassNewClass{publicstaticvoidmain(Stringargs[]){intxyx=(int)82.5y=(int)ASystem.out.print(&quotx=&quot+x)System.out.print(&quot\ty=&quot+y)}
}
A.82.5A
B.82A
C.82.565
D.8265
答案
4.下列选项中不属于Java核心包的一项是_______。
A.javax.naming
B.javax.rmi
C.javax.sound
D.java.math
答案
5.执行下列程序段,请选出正确的答案。publicclassTest{publicstaticvoidthrowit(){thrownewRuntimeException()}publicstaticvoidmain(Stringargs[]){try{System.out.println(&quot你好吗&quot)throwit()System.out.pri
A.不能通过编译
B.输出“你好吗”→RuntimeException异常发生→输出“出错!”→输出“结束”
C.输出“你好吗”→RuntimeException异常发生→输出“结束”
D.输出“你好吗”→输出“结束”→RuntimeException异常发生
答案
6.下面不属于Java语句的基本数据类型的是_______。
A.浮点型
B.整型
C.字符型
D.数组型
答案
7.下面程序段的输出结果为publicclassTest{publicstaticvoidmain(Stringargs[]){inta[]={123}b[]=newint[3]System.arraycopy(a0b03)System.out.println(&quota[0]=&quot+a[0]+&quotb[0]=&quot+b[0])a[0]=10System.out.println(&quota
A.a[0]=1b[0]=1a[0]=10b[0]=1
B.a[0]=10b[0]=1a[0]=10b[0]=1
C.a[0]=1b[0]=10a[0]=1b[0]=10
D.a[0]=10b[0]=10a[0]=1b[0]=1
答案
8.下面程序段的输出结果为_______。classOverMethod{voidprintMeth(){System.out.println(&quotThereisnoneparameter.&quot)}voidprintMeth(Stringt){System.out.println(&quotThereisoneparameter.&quot)}voidprintMe
A.Thereisnoneparameter.Thereisoneparameter.Therearetwoparameters.
B.Thereisoneparameter.Thereisnoneparameter.Therearetwoparameters.
C.It’sgood!Thereisnoneparameter.Therearetwoparameters.
D.Thereisnoneparameter.It’sgood!Therearetw
答案
9.如果在编译Java程序时,编译结果报告说找不到编译的代码,下列哪一项不是常见的错误?
A.没有import相应的包
B.文件名拼写错误
C.未加.java后缀
D.源文件不在当前目录下
答案
10.下面程序段的输出结果为_______。publicclassTest{publicstaticvoidmain(Stringargs[]){charc1c2c3c1=Hc2=\\c3=\115System.out.print(c1)System.out.print(c2)System.out.print(c3)
A.H\M
B.H\\\115
C.H115
D.无输出
答案

北京语言大学
奥鹏作业答案请联系QQ515224986
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|www.openhelp100.com ( 冀ICP备19026749号-1 )

GMT+8, 2024-5-10 04:07

Powered by openhelp100 X3.5

Copyright © 2001-2024 5u.studio.

快速回复 返回顶部 返回列表