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.

                  Returned By
public class InterruptedException extends Exception {  
// Public Constructors
   public InterruptedException();  
   public InterruptedException( String s);  
}

Thrown By

Object.wait(), Thread.{join(), sleep()}

Get J2ME in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.