阿摩線上測驗 登入

試題詳解

試卷:94年 - 2005年4月计算机等级考试— 二级—《 JAVA 》#13700 | 科目:计算机等级考试— 二级—《 JAVA 》

試卷資訊

試卷名稱:94年 - 2005年4月计算机等级考试— 二级—《 JAVA 》#13700

年份:94年

科目:计算机等级考试— 二级—《 JAVA 》

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.put.println("Hello"); } } }
(A)sleep(1000) InterruptedException
(B)sleep(1000) InterruptedException
(C)Thread.sleep(1000) RuntimeException
(D)Thread.sleep(1000) InterruptedException
正確答案:登入後查看