APIdia Launch Partner
Top Description Fields Constructors
java.lang

public Class InterruptedException

extends Exception
Class Inheritance

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.

Author
Frank Yellin
Since
1.0
See Also
Thread Interruption

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
InterruptedException()

Constructs an InterruptedException with no detail message.

public
InterruptedException(String
the detail message.
s
)

Constructs an InterruptedException with the specified detail message.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.Exception.serialVersionUID.

Annotations
@Serial

Constructor Detail

InterruptedExceptionback to summary
public InterruptedException()

Constructs an InterruptedException with no detail message.

InterruptedExceptionback to summary
public InterruptedException(String s)

Constructs an InterruptedException with the specified detail message.

Parameters
s:String

the detail message.