This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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


Win a copy of Building Microservices this week in the Design forum!
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: exit of JVM
 
It's not a secret anymore!