File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes Question on Thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Question on Thread" Watch "Question on Thread" New topic
Author

Question on Thread

Suresh Rajadurai
Ranch Hand

Joined: Feb 22, 2007
Posts: 58
Hi Gurus,

Can anybody explain me why the following code is giving run-time error?



Output is:
foo
Exception in thread "main" java.lang.IllegalThreadStateException


many thanks

Suresh.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3826

Suresh Rajadurai wrote:



Output is:
foo
Exception in thread "main" java.lang.IllegalThreadStateException


You are starting a Thread t which is already started, which cause an IllegalThreadStateException.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question on Thread