• 通过实现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 ++);
    }
    }

    正确答案:testObj 1.start();testObj 1.start();
  • 2021年07月13日 20时01分来自  问答库 >> 计算机类
  • 评论 0
  • 手机玩微博

    手机版 手机端
    Powered by 日新微博 © 2018 - 2020 日新网