Class InterruptedException

All Implemented Interfaces:
Serializable

public class InterruptedException extends Exception
Thrown when a thread executing a blocking method is interrupted. Thread.sleep, Object.wait and many other blocking methods throw this exception if interrupted.

Blocking methods that throw InterruptedException clear the thread's interrupted status before throwing the exception. Code that catches InterruptedException should rethrow the exception, or restore the current thread's interrupted status, with Thread.currentThread().interrupt(), before continuing normally or handling it by throwing another type of exception.

Since:
1.0
See Also:
  • Constructor Details

    • InterruptedException

      public InterruptedException()
      Constructs an InterruptedException with no detail message.
    • InterruptedException

      public InterruptedException(String s)
      Constructs an InterruptedException with the specified detail message.
      Parameters:
      s - the detail message.