通过实现Rmmable接口创建线程,请在下面横线处填写代码完成此程序。public class ThreadTest { pub

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

通过实现Rmmable接口创建线程,请在下面横线处填写代码完成此程序。

public class ThreadTest

{

public static void main(String args [])

{

Thread testObj1 = new Thread (new Hello ());

Thread testObj2 = new Thread (new Hello ());

testObj 2.start ( );

}

}

class Hello implements Runnable

{

int j;

public void run()

{

System.out.println("Hello" + j ++);

}

}

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
更多相关问题