Originally posted by mark stone:
setDaemon method when set to true causes that thread to be a daemon thread instead of user.
i wrote a code and threads in there were set to daemon, and none of the thread ran. this is fine as threads were set to be daemon.
question is what are we trying to achieve then ? can someone explain ? also i know that if one of the user thread exists the other daemon threads would run. so what's the big deal. what are we trying to achieve.
Originally posted by mark stone:
setDaemon method when set to true causes that thread to be a daemon thread instead of user.
i wrote a code and threads in there were set to daemon, and none of the thread ran. this is fine as threads were set to be daemon.
question is what are we trying to achieve then ? can someone explain ? also i know that if one of the user thread exists the other daemon threads would run. so what's the big deal. what are we trying to achieve.
and second what is the concept of "daemon thread group". what is the group here. daemon is set inidividually for a particular thread. where is the group here ?
i had posted this question and answer is 4 but can someone explain why 4 ?
---------------------------------------
A demon Thread group
1 has only demon threads.
2 can have non demon threads.
3 does not exist after all non demon threads in the group have finished executing.
4 does not exist after all the threads in the group have finished executing.
Answer :4
---------------------------------------
JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Originally posted by Marilyn deQueiroz:
[ January 28, 2002: Message edited by: Marilyn deQueiroz ]
Originally posted by Marilyn deQueiroz:
[ January 28, 2002: Message edited by: Marilyn deQueiroz ]