Nagendran
IllegalThreadStateException
1 Answer(s)      3 years and a month ago
Posted in : Java Interview Questions

whis is the IllegalThreadStateException in java? or define IllegalThreadStateException with exp?

Advertisement
View Answers

March 28, 2012 at 1:14 PM


IllegalThreadStateException is thrown to indicate that a thread is not in an appropriate state for the requested operation.

Example

public class Demo extends Thread
{
   public static void main(String args[])
   {
       Demo d1 = new Demo();
       d1.start();
       d1.start();
   }
}









Related Tutorials/Questions & Answers:
IllegalThreadStateException
IllegalThreadStateException  whis is the IllegalThreadStateException in java? or define IllegalThreadStateException with exp?   IllegalThreadStateException is thrown to indicate that a thread is not in an appropriate
Daemon Threads
or it will throw IllegalThreadStateException if thread is already started and running
Advertisements