B
.线程的优先级是在创建线程时设置的
C
.在创建线程后的任何时候都可以设置
D.B 和 C
( 31 )当浏览器重新返回 Applet 所在页面时,将调用 Applet 类的方法是 (
A
) 。A.start() B.init() C.stop() D.destroy()
( 32 )按照 Java 的标识符命名规范,下列表示一个类的标识符正确的是 (
B
) 。A.Helloworld B.HelloWorld C.helloworld D.helloWorld
(33)下列代码中,将引起一个编译错误的行是 (
D
)。
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 行
(
34
“
)下列程序的功能是在监控台上每隔一秒钟显示一个字符串 Hello”,能够填写在程
序中下划线位置,使程序完整并能正确运行的语句是 (
D
)。
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.put.println("Hello");
}
}
}
A. sleep(1000)
InterruptedException
B. sleep(1000)