• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setDaemon

 
saravanan ragunathan
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


when i run this code it generates IllegalThreadStateException in runtime
how can i rectify this
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the documentation? Because the answer is right there.
 
Santosh Kumar Nayak
Ranch Hand
Posts: 143
Eclipse IDE IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setDaemon() has to be specified before the execution of the thread.start() method.

While the thread is executing specifying the thread as daemon is not allowed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic