2007年9月计算机考试二级Java模拟试题一及答案

出处:Examlink 作者:刀断水 日期:2007年08月30日 13时27分

31.当浏览器重新返回 Applet 所在页面时,将调用 Applet 类的方法是____。
A、start()
B、init()
C、stop()
D、destroy()
A       B       C       D      
32.按照 Java 的标识符命名规范,下列表示一个类的标识符正确的是____。
A、Helloworld
B、HelloWorld
C、helloworld
D、helloWorld
A       B       C       D      
33.下列代码中,将引起一个编译错误的行是____。
1)public class Test{
2) int m,n;
3) public Test(){}
4) public Test(int a){m=a;}
5) public static void main(String args[]){
6) Test t1,t2;
7) int j,k;
8) j=0;k=0;
9) t1=new Test();
10) t2=new Test(j,k);
11) }
12) }
A、第3行
B、第5行
C、第6行
D、第10行
A       B       C       D      
34.下列程序的功能是在监控台上每隔一秒钟显示一个字符串“Hello!”,能够填写在程序中下划线位置,使程序完整并能正确运行的语句是____。
public class Test implements Runnable{
public static void main(String args[]){
Test t=new Test();
Thread tt=new Thread(t);
tt.start();
}
public void run(){
for(;;){
try{
____;
}catch(____ e){}
System.out.println("Hello");
}
}
}
A、sleep(1000)
InterruptedException
B、t.sleep(1000)
InterruptedException
C、Thread.sleep(1000)
RuntimeException
D、Thread.sleep(1000)
InterruptedException
A       B       C       D      
35.阅读下列代码后
public class Person{
int arr[]=new int[10];
public static void main(String args[]){
System.out.println(arr[1]);
}
}
正确的说法是
A、编译时将产生错误
B、编译时正确,运行时将产生错误
C、输出零
D、输出空
A       B       C       D

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

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

考试全流程