public class Test { static String s = "One "; public static void main(String[] args) { new Test().method1(); System.out.println(s); } static void method1(){ try{ method2(); } catch(Exception e){ s += "Two "; } } static void method2() throws Exception{ s += "Three "; method3(); s += "Four "; method3(); s += "Five "; } static void method3() throws Exception{ s += "Six "; throw new Exception(); } }
Why the output of this is not == > One Three Six Four Six Five
Can someone explain what exception is occur and where it occur??