• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

daemon thread?

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The daemon status of a thread can be changed at any time using the Thread.setDaemon method??

why this is wrong ???is it that the status can be changed only at the begining of the thread???
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The daemon status of a thread can be changed at any time using the Thread.setDaemon method??

why this is wrong ???is it that the status can be changed only at the begining of the thread???

The reason being that you cannot change the Daemon status of the thread after the start() method gets called otherwise a n IllegalThreadStateException is thrown. You should call the method Thread.setDaemon() before calling the start method on the thread.

I hope you got it.

Regards,
Saurabh
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in the K&B book i found nothing about deamon threads, so may i conclude this will not be on the exam?

also for the "you can call a method on a thread object after you invoke start, unless you get IllegalThreadStateException", nothing found in the book, and on school it was burned in like hell
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic