Dead A thread is considered dead when its run() method completes. It may still be a viable Thread object, but it is no longer a separate thread of execution. Once a thread is dead, it can never be brought back to life! (The whole "I see dead threads" thing.) If you invoke start() on a dead Thread instance, you�ll get a runtime (not compiler) exception.
The following code does not give me an java.lang.IllegalThreadStateException
it compiles and runs fine.
The answer to this is (from "Java Threads, 2nd Edition" by S. Oaks and H. Wong, Chapter 2.6)
What happens when you try to restart a thread? The answer is that it actually depends on when you restart it ... it actually takes time for a thread to stop. ... If the start() method is called after the stopping thread has actually stopped, nothing happens: the thread object is in a state where it cannot be restarted
Can an exam question go into such low level details?
Gian Franco [ May 20, 2004: Message edited by: Gian Franco Casula ]