下列程序的创建了一个线程并运行,请填空,使程序完整。public class ThreadTest{public static void main(String args[]){Hello h=new Hello();____;t.start();}}class Hello implements Runnable{int i;public void run(){while(true){System.out.println("Hello"+i++);if(i==5) break;}}}
关于下列程序的功能,说法正确的是public class ko10_1 extends Thread{int n;ko10_1(){Thread td=new Thread(this);td.start();}public void run(){for (n=0;n<6;n++){try{System.out.print(n);Thread.sleep(500);}catch(InterruptedException e){ System.out.println("Exception"); }}}public static void main(String args[]){new ko10_1();}}
A. 这段程序的功能是:每隔500秒打印012345
B. 这段程序的功能是:每隔1秒打印012345
C. 这段程序的功能是:每隔半秒打印012345
D. 这段程序的功能是:每隔半分钟打印012345
使比其自身优先级低的线程运行的Thread类的方法是:A、sleep()B、yiele()C、join()D、interrupt()
A. sleep()
B. yiele()
C. join()
D. interrupt()
[音频]
A. Yes, I do.
B. No, I don't.
C. Yes, that'll be all right.
D. No problem.