奥鹏答案网-奥鹏作业答案-奥鹏在线作业答案-奥鹏离线作业答案-奥鹏毕业论文-专业奥鹏作业答案辅导网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 154|回复: 0

[北京语言大学]20春《Java语言程序设计》作业1(参考答案)

[复制链接]

2万

主题

2万

帖子

6万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
64471
发表于 2020-5-18 11:23:43 | 显示全部楼层 |阅读模式

试卷名称:20春《Java语言程序设计》作业1
1.下面程序段的输出结果是_______。public class Test{  public static void main(String args[]){  int x,y;x=(int)Math.sqrt(5)/2+(int)Math.random()*5/2;y=(int)Math.sqrt(3)/2+(int)Math.random()*3/2;if(xy)System.out.println("xy");
A.xy
B.x=y
C.xy
D.编译错误
答案:-

2.下列程序段不正确的是_______。
A.String A="firstJava";A-="Java";
B.String A="firstJava";A+="Java";
C.Integer J=new Integer(27);J-=7;
D.Integer J=new Integer(27);J--;
答案:-

3.下面程序段的输出结果为_______。public class NewClass {    public static void main(String args[]){     int x,y;x=(int)82.5;y=(int)'A';System.out.print("x="+x);System.out.print("\ty="+y);}
}
A.82.5 A
B.82 A
C.82.5 65
D.82 65
答案:-

4.下列选项中不属于Java核心包的一项是_______。
A.javax.naming
B.javax.rmi
C.javax.sound
D.java.math
答案:-

5.执行下列程序段,请选出正确的答案。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异常发生
答案:-

6.下面不属于Java语句的基本数据类型的是_______。
A.浮点型
B.整型
C.字符型
D.数组型
答案:-

7.下面程序段的输出结果为public class Test {public static void main(String args[]){int a[]={1,2,3},b[]=new int [3];System.arraycopy(a, 0, b, 0, 3);System.out.println("a[0]="+a[0]+" b[0]="+b[0]);a[0]=10;System.out.println("a
A.a[0]=1 b[0]=1 a[0]=10 b[0]=1
B.a[0]=10 b[0]=1 a[0]=10 b[0]=1
C.a[0]=1 b[0]=10 a[0]=1 b[0]=10
D.a[0]=10 b[0]=10 a[0]=1 b[0]=1
答案:-

8.下面程序段的输出结果为_______。class OverMethod{void printMeth(){System.out.println("There is none parameter.");}void printMeth(String t){System.out.println("There is one parameter.");}void printMe
A.There is none parameter.There is one parameter.There are two parameters.
B.There is one parameter.There is none parameter.There are two parameters.
C.It’s good!There is none parameter.There are two parameters.
D.There is none parameter.It’s good!There are tw
答案:-

9.如果在编译Java程序时,编译结果报告说找不到编译的代码,下列哪一项不是常见的错误?
A.没有import相应的包
B.文件名拼写错误
C.未加.java后缀
D.源文件不在当前目录下
答案:-

10.下面程序段的输出结果为_______。public class Test {public static void main(String args[]){char    c1,c2,c3;c1='H';c2='\\';c3='\115';System.out.print(c1);System.out.print(c2);System.out.print(c3);
A.H\M
B.H\\\115
C.H115
D.无输出
答案:-
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 价格公开

  • 优质服务

  • 专属客服

  • 信息开放

  • 担保交易

 
 
客服一号
客服二号
客服三号
客服四号
点击这里给我发消息
官方微信扫一扫
快速回复 返回顶部 返回列表