File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes exit of JVM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "exit of JVM" Watch "exit of JVM" New topic
Author

exit of JVM

Aru
Ranch Hand

Joined: Jul 20, 2000
Posts: 112
Hi All,

Does JVM exits after the main() thread ?
I think it does - True.
But I found that one of the mock test says that some other threads may still be running.
How is this possible ? Can anyone explain.
Your help is appreciated.
Thx in Advance.
Aruna
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
Does JVM exits after the main() thread?
1) if main() method (main thread) did not start other thread, JVM exits
2) if other (non-daemon) thread was constructed in main() method, and this new thread is still running, JVM will wait until it finishes.
2) if main() method ended and there are only daemon threads running, JVM exits.


Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exit of JVM