Name
InterruptedException
Synopsis
In J2SE, this exception is thrown when one thread uses the
interrupt() method to interrupt another thread
that is blocked due to the Thread
sleep()
or join() methods. In CLDC, however, the
Thread
interrupt() method does not
exist, so this exception will not actually be thrown in these cases.
However, for reasons of compatibility, this exception is still declared to
be thrown from the Object
wait() and
the Thread
sleep()
and join() methods.
The actual use of this exception is in the implementation of the socket support for the Generic Connection Framework, which is not a required part of the specification and is not visible to application code.
This class is the same as its J2SE equivalent, apart from its inability to be serialized.
public class InterruptedException extends Exception {
// Public Constructors
public InterruptedException();
public InterruptedException( String s);
}
Thrown By
Object.wait(), Thread.{join(), sleep()}
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access