About the finally statement block
The 1.finally statement block can be directly associated with a try statement block. Try....finally ...
2.try...catch....finally can also.
3. The code in the finally statement block is bound to be executed.
4. If you exit the jvm,finally statement block before executing the finally statement block, it will not execute.
public class Exceptiontest08{public static void Main (string[] args) throws Exception{/*try{system.out.println ("ABC"); return;} Finally{system.out.println ("Test");} *//*try{fileinputstream fis = new FileInputStream ("Test.java");//Do not execute System.out.println ("Tttt");} finally{//will execute System.out.println ("AAAAA");} *///If you exit the JVM before the finally statement block is executed, the finally statement block does not execute. try{//exit Jvmsystem.exit (0); finally{//will not execute. System.out.println ("finally ....");}}
This article is from the "Gaogaozi" blog, make sure to keep this source http://hangtiangazi.blog.51cto.com/8584103/1661700
Finally statement block in Java exception