-->
当前位置:首页 > 题库 > 正文内容

单选题:下列Java程序的功能是在监控台上每隔一秒钟显示一个字符串"Hello!",请选择填空。

Luz4年前 (2021-12-25)题库631
下列Java程序的功能是在监控台上每隔一秒钟显示一个字符串"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)<br>
InterruptedException
B.t.sleep(1000)<br>
InterruptedException
C.Thread.sleep(1000)<br>
RuntimeException
D.Thread.sleep(1000)<br>
InterruptedException


答案:C

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。