• 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

Help Please

 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please explain why answers 2,4 is correct. i have no idea.
A demon Thread group
1. has only demon threads. (False)
2. can have non demon threads. (True)
3. does not exist after all non demon threads in the group have finished executing. (False)
4. does not exist after all the threads in the group have finished executing. (True)
any help would be appreciated.
vivek
 
Vivek Shrivastava
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looking forward to hear from u guys.
I would realy appreciate it.
vivek
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[B]Please explain why answers 2,4 is correct. i have no idea.
A demon Thread group
1. has only demon threads. (False) true by JLS.
2. can have non demon threads. (True)true by JLS
3. does not exist after all non demon threads in the group have finished executing. (False) Not true coz anythread group exists till any of its thread is alive.
4. does not exist after all the threads in the group have finished executing. (True) true by JLS.
Don't confuse between demon thread v/s demon thread group.
Ofcourse all demon threads will die once there is no non-demon thread alive. :-)
right?
 
Vivek Shrivastava
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi hemanshow,
First of all thanks. do u want to say answer '1' is also correct?
waiting for reply.
vivek
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi vivek,
do you know now, what is the correct answer?
regds
zhewen
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vivek,
A daemon thread group can be creaed using the setDaemon(true) method of the ThreadGroup class. A group's daemon status applies only to the group. Changing a group's daemon status does not affect the daemon status of any of the threads in the group. Furthermore, a group's daemon status does not in any way imply the daemon status of its threads--you can put any thread within a daemon thread group.
The daemon status of a thread group simply indicates that the group will be destroyed when all of its threads have been terminated. Thus a daemon thread group can have both user and daemon threads. Hope this answers two of u r multiple choice answers
1. has only demon threads. (False)
// can have user threads also.
2. can have non demon threads. (True)
// yes see explanation above
3. does not exist after all non demon threads in the group have finished executing. (False)
//will continue to exist till all daemon threads and user threads are executing
4. does not exist after all the threads in the group have finished executing. (True)
// look at answer above
regds.
Rahul

[This message has been edited by rahul_mkar (edited July 19, 2000).]
 
zhewen
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi rahul, thank you so much, could you pl. also check the question that i posted today with file pathname etc..
zhewen
 
reply
    Bookmark Topic Watch Topic
  • New Topic