← 返回首页
InterruptedException (Java SE 26 & JDK 26)
JavaScript is disabled on your browser.
Contents  
  1. Description
  2. Constructor Summary
  3. Method Summary
  4. Constructor Details
    1. InterruptedException()
    2. InterruptedException(String)
Hide sidebar  Show sidebar

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:

Scripting on this page tracks web page traffic, but does not change the content in any way.