All About Class InterruptedException in Java


InterruptedException is thrown from an application when a thread is waiting ,sleeping or otherwise paused for a long time and another thread interrupts it using the interrupt() method defined in class Thread.In effect, it is a way to break out those methods before they complete their normal cycle.

The structure of the class InterruptedException is given as :


public class java.lang.InterruptedException extends java.lang.Exception{
//constructor
public InterruptedException();
//constructs an empty InterruptedException object that is an object with no message specified.
public InterruptedException(String message);
//constructs an InterruptedException object with the message specified.

}
 

All About Class InterruptedException in Java All About Class InterruptedException in Java Reviewed by Animesh Chatterjee on September 18, 2018 Rating: 5

No comments:

Powered by Blogger.