A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

What is InterruptedException ?

program for InterruptedException

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);

      }

   }

}


output


 











LEARN TUTORIALS

.

.