Mat*_*att 7 java multithreading
如果我在Thread对象上使用start()并且run()方法返回,是否可以再次调用start()?
例如,
MyThread myThread = new MyThread();
myThread.start();
// run method executes and returns in 2 seconds
// sleep for 5 seconds to make sure the thread has died
myThread.start();
Run Code Online (Sandbox Code Playgroud)
我只是想知道因为我的代码抛出了IllegalThreadStateExceptions,所以想知道是不是因为你不能做到这一点.