Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on Thread  RSS feed

 
Suresh Rajadurai
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Posts: 3997
42
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!