Starting a thread, joining it, then starting it again - which of the following is true?
Thread t = new Thread(() -> System.out.println("working"));
t.start();
t.join();
t.start();
Answer: C
A thread may not be started twice, and cannot be restarted even after run() has finished. The first call succeeds and prints; the second throws IllegalThreadStateException in the main thread. Note the failure is at runtime, not compile time: nothing in the type system tracks whether start() has already happened.
Please log in or register to report this question.