2006年9月全国计算机等级考试二级Java程序设计笔试试卷
出处:www.examlink.com 作者:小罗 日期:2007年01月22日 15时37分
(
21)阅读下面程序
public class Increment{
public static void main(String args[]{
int c;
c=5;
System.out.println(c);
System.out. println(c++);
System.out.println(c);
}
}
程序运行结果是
_____。
A)
5
6
6
B)
5
5
6
C)
6
7
7
D)
6
6
6
(
22)下列叙述中,错误的是
_____。
A)
JavaApplication 与
Applet 所用编译命令相同
B)通常情况下
Java Application 只能有一个
main()方法
C)
JavaApplet 必须有
HTML 文件才能运行
D)
JavaApplet 程序的
.class 文件可用
java 命令运行
(
23)下列关于
Java 语言中线程的叙述中,正确的是
_____。
A)线程是由代码、数据、内核状态和一组寄存器组成
B)线程间的数据是
不共享的
C)用户只能通过创建
Thread 类的实例或定义,创建
Thread 子类的实例建立和控制
自己的线程
D)因多线程并发执行而引起的执行顺序的不同定性可能造成执行结果的不稳定
(
24)阅读下面程序
_____。
import javax.swing.JOptionPang;
public class BreakLabelTest{
publicstatic void main(String args[]){
String output=""
;
stop:{
for(int row=1;row<=10;row++){
for(int column=1;column<=5;column++){
if(row==5)
break stop;
output+=""
;
}
output += “n”;
}
output+= “\nLoops terminated normally”;
}
JOptionPane.showMessageDialog(
Null,output, “用一个标志测试
break 语句
”,
JOptionPane.INFORMATION_MESSAGE);
System.exit( 0 );
}
}
程序运行结果是
A)窗口中有
5 行
·····
B)窗口中有
5 行
····
C)窗口中有
4 行
·····
D)窗口中有
6 行
·····
(
25)处理对象传输的接口是
_____。
A)
Serializable B)
Cloneable C)
ItemListener D)
ActionListener
(
26)在读取二进制数据文件的记录时,为了提高效率常常使用一种辅助类
_____。
A)
InputStream B)
FileInputStream C)
StringBuffer D)
BufferedReader
最后更新时间:2008-03-28 12:09:50