This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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: 3899
    
    9

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
 
It's not a secret anymore!