Given:
Which one is correct?
Given:
Which one is correct?
In Java, once a thread has been started and completes its execution, it cannot be restarted. Attempting to restart a thread by calling its start() method again will throw an IllegalThreadStateException. In the given code, the thread 't1' is started twice, which leads to an IllegalThreadStateException at runtime, making option A the correct answer.
t1.start() => once java start a thread cannot be restarted. so Ilegal IllegalThreadStateException is thrown
Tested: A.
A is correct, tested. It works if you remove the second t1.start(); argument which is the one causing the exception.
A is correct TESTED