网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

下列程序的功能是在监控台上每隔一秒钟显示一个字符串”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


参考答案

更多 “ 下列程序的功能是在监控台上每隔一秒钟显示一个字符串”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)InterruptedExceptionInterruptedExceptionC.Thread.sleep(1000)D.Thread.sleep(1000)RuntimeExceptionInterruptedException ” 相关考题
考题 下列程序的功能是在监控台上每隔一秒钟显示一个字符串"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); InterruptedExceptionB.t. sleep(1000); InterruptedExceptionC.Thread. sleep(1000); RuntimeExceptionD.Thread. sleep(1000); InterruptedException

考题 下列程序的功能是在监控台上每隔一秒钟显示一个字符串“你好!”,能够填写在程序中画线位置,使程序完整并能正确运行的语句是 public class Exam implements Runnable{ public static void main(String args[]){ Exam t=new Exam(); Thread tt=new Thread(t); tt.start(); } public void run(){ for(;;){ try{ ; }catch(e){} System.out.println("你好!"); } } }A.sleep(1) RuntimeExceptionB.t.sleep(1000) InterruptedExceptionC.Thread.sleep(1) InterruptedExceptionD.Thread.sleep(1000) InterruptedException

考题 下列程序的功能是创建一个显示5个“Hello!”的线程并启动运行,试将程序补充完整。public class ThreadTest extends Thread{public static void main(String args[ ]){ThreadTest t=new______;t.start( );}public void run( ){int i=0;while(true){System.out.println("Hello!");if(i++==4)break;}}

考题 下列程序的功能是将一个整数数组写入二进制文件,在程序的下画线处应填人的选项是( )。A.writeArrayB.writeByteC.writeIntD.writeDouble

考题 在下画线处填入代码,使程序正常运行并且输出“Hello!”。class Test ______ {public staric void maim (string[] args) {Test t=new Test();t.start();}public void run() {System.out.println("Hello!");}}

考题 下列程序的功能是在监控台上每隔一秒钟显示一个字符串“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)B.t.sleep(1000)InteruptedException InterruptedExceptionC.Thread.sleep(1000)D.Thread.sleep(1000)RuntimeException InterruptedException

考题 下列程序的功能是在监控台上每隔一秒钟显示一个字符串"Hello!",能够填写在程序中下划线位置,使程序完整并能正确运行的语句是publicclassTestimplementsRunnable{publicstaticvoidmain(Stringargs[]){Testt=newTest();Threadtt=newThread(t);tt.start();}publicvoidrun(){for(;;){try{}catchL______e){}System.out.println("Hello");}}}A.B.C.D.

考题 下列程序的功能是在监控台上每隔-秒钟显示-个字符串”Hello!¨,能够填写在程序中下画线位置,使程序完整并能正确运行的语句是( )。A.sleep(1000)B.t. sleep(1000) InterruptedExceptionInterruptedExceptionC.Thread. sleep(1000)D.Thread. sleep(1000) RuntimeExceptionlnterruptedException

考题 阅读下面程序 public class Test implements Runnable { public static void main(String[] args) { ______ t.start(); } public void run() { System.out.println("Hello!"); } } 程序中下画线处应填入的正确选项是A.Test t=new Test();B.Thread t=new Thread();C.Thread t=new Thread(new Test());D.Test t=new Thread();