题目
下列程序的功能是每隔一秒钟输出一个字符串“Hello!”。
publicclassC3101implementsRunnable
{
publicstaticvoidmain(Stringargs[])
{
C3101t=newC3101();
Threadtt=newThread(t);
tt.start();
}
publicvoidrun()
{
for(;;)
{
try{
();
}catch(()){}
System.out.println("Hello");
}
}
}
第1题
A.sleep(1000)InterruptedException
B.t.sleep(1000)lntermptedException
C.Thread.sleep(1000)RuntimeException
D.Thread.sleep(1000)InterruptedExcepfion
第2题
A.sleep(1000)
B.t.sleep(1000)InteruptedException InterruptedException
C.Thread.sleep(1000)
D.Thread.sleep(1000)RuntimeException InterruptedException
第3题
A.sleep(1000)
B.t.sleep(1000)InterruptedExceptionInterruptedException
C.Thread.sleep(1000)
D.Thread.sleep(1000)RuntimeExceptionInterruptedException
第4题
A.sleep(1) RuntimeException
B.t.sleep(1000) InterruptedException
C.Thread.sleep(1) InterruptedException
D.Thread.sleep(1000) InterruptedException
第5题
A.sleep(1000); InterruptedException
B.t. sleep(1000); InterruptedException
C.Thread. sleep(1000); RuntimeException
D.Thread. sleep(1000); InterruptedException
第8题
第9题
给定程序MODll.C中函数fun的功能是:读入一个字符串(长度<20),将该字符串中的所有字符按ASCII码升序排序后输出。
例如,若输入:edcba,则应输出:abcde。
请改正程序中的错误,使它能统计出正确的结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构!
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!