12 A thread\'s run) method includes the following lines 1. try 2 3. \\ catch (In
ID: 3714516 • Letter: 1
Question
12 A thread's run) method includes the following lines 1. try 2 3. catch (InterruptedException e)) Assuming the thread is not interrupted, which one of the following statements is correct? Thread.sleep (100) O The code will not compile, because exceptions may not be O At line 2, the thread will stop running. Execution will resume in O At line 2, the thread will stop running. Execution will resume in O At line 2, the thread will stop running. Execution will resume caught in a thread's run) method at most 100 milliseconds exactly 100 milliseconds sometime after 100 millisecondsExplanation / Answer
Ans: At line 2, the thred will stop running. Execution will resume sometime after 100 milliseconds.
Explanation: sleep cause to halt the execution for specified time. After that time, thred goes in READY queue and whenever it get chance then it will resume the execution
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.