Why do I have to call System.exit() from my main method?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   gaurav_aggarwal
Posted On:   Saturday, April 14, 2001 11:01 PM

i hava learned from a book that when main creates two or three threads and starts them , if main terminates before then those threads experience immature termination. but practically that does not happen, why!

Re: Why do I have to call System.exit() from my main method?

Posted By:   Luigi_Viggiano  
Posted On:   Sunday, May 6, 2001 05:18 PM

If threads are set as non-daemon they will keep your application alive.
Check setDaemon(boolean) method, and your thread creation and startup: I can ensure you that all JVM must provide this behaviour about threads.
About | Sitemap | Contact