InterviewSolution
Saved Bookmarks
| 1. |
Can you start a thread twice? |
|
Answer» No, it's not at all possible to restart a thread once a thread gets started and completes its execution. Thread only runs once and if you try to run it for a SECOND time, then it will throw a runtime exception i.e., java.lang.IllegalThreadStateException. Output: thread is executing now........ Exception in thread "main" java.lang.IllegalThreadStateException |
|