File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes understanding when JVM might exit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "understanding when JVM might exit" Watch "understanding when JVM might exit" New topic
Author

understanding when JVM might exit

nitinram agarwal
Ranch Hand

Joined: Jan 29, 2009
Posts: 83
I was reading some article regarding exception handling and came across the following comment that the finally block may not be executed if the JVM exits. so I tried with the following simple example



and can see that the SOP in the finally block is not printing.
I want to understand the other scenarios in which the JVM might exit. I tried putting some code in the try block which throws ArrayIndexOutOfBoundsException but it is printing the statement in the finally block.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38519
    
  23
Look at this post.
nitinram agarwal
Ranch Hand

Joined: Jan 29, 2009
Posts: 83
thanks a lot for pointing to the article . it was reallly very useful
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38519
    
  23
You're welcome And the bit about the meteor is so memorable
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: understanding when JVM might exit