A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Programmer Certification (SCJP/OCPJP)
Joined: Sep 26, 2005
Oct 18, 2005 04:33:00
With respect to User and Daemon threads:
a) Daemon threads can not be destroyed
b) Running User threads prevent a JVM from terminating program
c) Running Daemon threads prevent a Java VM from terminating program
d) Daemon threads can not be grouped together
e) The JVM can terminate program when only daemon threads are running
answer: b, e? why e is correct?
Joined: Oct 05, 2005
Oct 18, 2005 05:03:00
Daemon threads exist only to serve User threads. Typically they will provide services to the User Threads and User Threads will do the real "work" in the program.
So if there doesn't exist any live User Thread, the JVM may choose to terminate the program even if there are daemon threads running.
SCJP, SCWCD, SCBCD
Joined: Aug 03, 2002
Oct 18, 2005 05:04:00
You can find out why e is correct by looking up the definition of a Daemon thread.
Ask a Meaningful Question
Getting someone to think and try something out is much more useful than just telling them the answer.
I agree. Here's the link:
subject: daemon thread.
User and Daemon threads
IBM mock: Daemon and user thread?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013