java中使用try-catch-finaly时的一些问题

我们在编写程序时经常会使用到try-catch-finaly,我在使用的时候发现一个问题,那就是不可以在finaly块中再次加入try-catch块,因为这样会使异常覆盖掉。
具体上代码解释一下。

public static void main(String[] args) throws Exception {
    try{
        throw new Exception("异常1");
    }catch (Exception e){
        throw new Exception("异常2");
    }finally {
        try {
            throw new Exception("异常3");
        } catch (Exception e) {
            throw new Exception("异常4");
        }
    }
}

输出结果:
Exception in thread “main” java.lang.Exception: 异常4
  at cn.com.dataocean.cip.web.Test.main(Test.java:22)
只抛出了一个异常4,并没有抛出异常2。所以以后不可以在finally块中的catch中抛出异常了。
所以我们在使用try-catch-finaly时要注意这一点,因为finaly块中的代码无论如何是会被执行,所以当我们正常的在catch块中抛得异常如果有finaly块,那么程序会继续执行到finaly块中,导致我们正常catch块中抛的异常会被覆盖掉。