Saturday, 25 May 2013

IllegalThreadStateException

Bismillahir Rahmanir Raheem

There are lots of ways that IllegalThreadStateException can occur , One of very common situation is when we try to start a thread that  already have started or completed .Because when we try to restart a thread , that thread can not handle that method in that state.So it results in IllegalThreadStateException at runtime.

class IllegalThreadState
{
   public static void main(String args[])
  {
    Thread thread=new Thread();
     thread.start();
     thread.start();
  }
}

No comments:

Post a Comment