finally关键字

final:禁止多态开关~
修饰变量:变量不能被改变
修饰类:类不能被继承
修饰方法:方法不能被重写

finally:用在异常处理的最后一个语句块
无论是否产生异常都要被执行~~~

Java代码 
 1     public final class FinallyTest { 
 2         public static void main(String[] args) { 
 3                try { 
 4                  throw new NullPointerException(); 
 5                } catch (NullPointerException e) { 
 6                  System.out.println("程序抛出了异常"); 
 7                } finally { 
 8                  System.out.println("执行了finally语句块"); 
 9                } 
10         } 
11     } 
原文地址:https://www.cnblogs.com/bigshow1949/p/5533722.html