Top Description Fields Constructors
java.lang

public Class InterruptedException

extends Exception
Class Inheritance

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();
if (Thread.interrupted())  // Clears interrupted status!
    throw new InterruptedException();
Author
Frank Yellin
Since
1.0
See Also
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Thread#sleep(long), java.lang.Thread#interrupt(), java.lang.Thread#interrupted()

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.