计算机二级习题练习

计算机二级考试Java每日一练(2015-10-23)
1题:下列程序的输出结果是(      )。 
Public class Test{
Public static void main(String[]args){
int[]array=(2,4,6,8,10); 
int size=6; 
int result=-l: 
try{
for(int i=0;iif(array[i]= =20)result=i: 
}
catch(ArithmeticException e){
System.out.println("Catch---1"); 
}
catch(ArraylndexOutOfBoundsException e){
System.out.println("Catch---2"): 
}
catch(Exception e){
System.out.println("Catch---3"): 
}
}
A.Catch---1 
B.Catch---2
C.Catch---3 
D.以上都不对
【单选题】:      

2题:在Java语言中,ObjectOutputStream是指(      )。 
A.字节流 
B.字符流 
C.对象输出流 
D.数据流
【单选题】:      

3题:某二叉树共有60个叶子结点与50个度为1的结点,则该二叉树中的总结点数为()。
A.148
B.169
C.182
D.198
【单选题】:      

4题:下列代码将对象写入的设备是()。
ByteArrayOutputStreambout=newByteArrayOut-
putStream();
ObjectOutputStreamout=newObjectOutputStream
(bout);
out.writeObject(this);
out.close();
A.内存
B.硬盘
C.屏幕
D.网络
【单选题】:      

5题:在Java中能实现多重继承效果的方式是()。
  
A.内部类
B.适配器
C.接口
D.同步
【单选题】:      

6题:下列选项中,不属于模块间耦合的是(      )。 
A.数据耦合 
B.标记耦合 
C.异构耦合 
D.公共耦合
【单选题】:      

7题:在文件类提供的方法中,用于创建目录的方法是(      )。 
A.mkdir() 
B.mkdirs()
C.list()
D.listRoots()
【单选题】:      

8题:下面程序的正确输出是()。
  publicclassHello


  {


  publicstaticvoidmain(Stringargs[])


  {


  intcount,xPos=25;


  for(count=1;count<=10;count++)


  {


  if(count==5)


  Break;


  system.Out.println(count);


  xPos+=10:


  }


  }


  }


  A.1234

  B.134

  C.编译错误

  D.以上都不正确
【单选题】:      

9题:一个Java Application运行后,在系统中是作为一个(      )。 
A.线程 
B.进程 
C.进程或线程 
D.不确定 
【单选题】:      

10题:下列说法中,不属于数据模型所描述的内容是(      )。 
A.数据结构 
B.数据操作 
C.数据查询
D.数据约束
【单选题】:      

 

您正在结束答题

请确认是否提交试卷?

继续做题 确认提交