Multiple choice technology programming languages

Restarting a thread leads to:

  1. ThreadRestartExcetion

  2. IllegalThreadStateException

  3. IllegalMonitorStateException

  4. none

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Java, once a thread has completed its execution (run() method returns), it cannot be restarted. Attempting to call start() on a thread that has already been executed results in IllegalThreadStateException because the thread is already in a terminated state and can only be started once.