What happens when you invoke a thread's interrupt method while it is sleeping or waiting?

What happens when you invoke a thread's interrupt method while it is sleeping or waiting?

Resam
Views: 2357 | Community Opinion: 2

Tags..  Thread Methods  Java Interview  Core Java

Bookmark this page..



Ask a New Question Go to Home

Community Opinion/Answers
 
Hormish Said..

When a task's interrupt() method is executed, the task enters the ready state. The next time the task enters
the running state, an InterruptedException is thrown.




Amit Saxena Said..

Invoking interrupt method on the thread which us sleeping
will throw an "java.lang.InterruptedException"






What do you think? Add your opinion/answer
*Name
*your opinion/answer: