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 BCloneable CItemListener DActionListener
26)在读取二进制数据文件的记录时,为了提高效率常常使用一种辅助类_____
A
InputStream BFileInputStream CStringBuffer DBufferedReader

 

最后更新时间:2008-03-28 12:09:50
文章评论
共有 0 位网友发表了评论
用户名: 新注册) 密码: 匿名评论 [查看所有评论]

评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
您可以用以下几种方式找到此文章

考试全流程