Hi All, In the K&B book, it is mentioned that "If you invoke start() on a dead Thread instance, you�ll get a runtime (not compiler) exception." But the following code *does not* give me any errors/exceptions. What am I missing?
You aren't missing anything, this is due to the JVM's implementation. In reality JVMs just ignore the attempt to start a dead thread. How ever if you have a question in the exam about re-starting a dead thread, the answer is always "throws a runtime exception".
It is important to note that your test case does not clearly demonstrate the given behaviour. I've trimmed your test case down, but there is one very important point that you missed. I hope this helps: