每日一练:计算机二级考试Java每日一练(2014-12-16)
【单选题】
下列程序的功能是在监控台上每隔一秒钟显示一个字符串”Hello!”,能够填写在程序中下画线位置,使程序完整并能正确运行的语句是( )。
public class Test implements Runnable{
public static void main(String args[]){
Test t=new Test():
Threadt t=new Thread(t);
tt.start():
}
public void run(){
for(;;){
try{
;
}catch(e){}
System.out.println("Hello");
}
}
}
A.sleep(1000) B.t.sleep(1000)
InterruptedExceptionInterruptedException
C.Thread.sleep(1000)D.Thread.sleep(1000)
RuntimeExceptionInterruptedException
在下面提交答题后即可查看答案与考友试题分析
发布评论 查看全部评论