public class java.lang
InterruptedException


Show All Login
Java SE 6
  
Extends: Throwable > Exception
Details
Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity. Occasionally a method may wish to test whether the current thread has been interrupted, and if so, to immediately throw this exception. The following code can be used to achieve this effect:
  if (Thread.interrupted())  // Clears interrupted status!
      throw new InterruptedException();
 
version1.17, 11/17/05
sinceJDK1.0
See also wait(), wait(long), wait(long, int), sleep(long), interrupt(), interrupted()

Constructors
public InterruptedException()
Constructs an InterruptedException with no detail message.
public InterruptedException(String s) Details
Constructs an InterruptedException with the specified detail message.
sthe detail message.