/* public class Test{ public static void main(String[] args){ int i=0; try{ func();//区别就是该函数抛出的异常被封装了,外界不知道到底会不会发生该异常 System.out.println("i = " + i++);//所以这句话是有机会执行的 }catch(Exception e){ System.out.println("i = " + i++); } } static void func() throws Exception{ throw new Exception(); } } */ public class Test{ public static void main(String[] args){ int i=0; try{ throw new Exception(); System.out.println("i = " + i++);//完全的废话,肯定不会被执行到 }catch(Exception e){ System.out.println("i = " + i++); } System.out.println("i = " + i++); } }