通过实现Runnable接口创建线程,请在画线处加入正确的代码完成此程序______
问题:
通过实现Runnable接口创建线程,请在画线处加入正确的代码完成此程序______。 publicclass ThreadTest { publicstaticvoid main(Stringargs[]) { Threadt1=newThread(newHello()): Threadt2=newThread(newHellO()); T2.start(); } } classHelloimplementsRunnable { intI; publicvoidIUB() { while(true) { System.out.println(“Hello”+i++); If(i==5)break; } } }