/* 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++);}
}