40. What Exception is thrown when you start a thread twice ? (A) InterruptedException (B) NullPointerException (C) IOException (D) IllegalStateException
Answers
Answered by
0
Answer:
a..interrupted exception
Answered by
0
Illegal state Exception
Explanation:
- Signals is that method which has been appeared at an inappropriate or illegal time. In the other words, Java-environment or Java-application is not in appropriate-state for requested operation.
- After starting or coming a thread, it can never start again. If you try to do so, an Illegal-Thread State-Exception is thrown. In such case, Thread will only run once but for the second time, it will throw the exception.
Similar questions