What is InterruptedException
It is never thrown in body of corresponding try statement catch(InterruptedException e).
An InterruptedException is occur when a thread is in sleep or in waiting mode.
It comes under java.lang.Exception.InterruptException package.
The InterruptedException is a checked exception.
Program of interruptedException:-
class Two
{
public static void main(String args[])
{
try
{
System.out.println("Hello Vishnu");
}
catch(InterruptedException e)
{
System.out.println(e);
}
}
}