• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JVM

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When does the JVM exit?

1)After the main method returns.
2)After all the non demons threads created by the application complete.
3)After all the demon threads created by the application complete
4)When a thread executes System.exit();
5)When an uncaught exception is thrown in a non demon thread.
6)When an uncaught exception is thrown in a demon thread.

Answer given is 2, 4, 5 & 6.
Why not 1 ? and Why 6 ?
Thanx
sp
-------
 
Ranch Hand
Posts: 3143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where does this question come from?
Please read the note at the top of the page, that if you are using a question from a Mock Exam that you must specify the source!
Just a polite reminder!
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please see my post about this here.. http://www.jchq.net/discus/messages/1/1009.html?FridayAugust2520000215am
If an uncaught exception is thrown by some (daemon or non daemon) thread then that thread ends not the whole program.
HTH,
Paul.
------------------
http://pages.about.com/jqplus
Get Certified, Guaranteed!
 
Remember to always leap before you look. But always take the time to smell the tiny ads:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic