I have an exception related issue
i have a class A, class B when i call some method of class B from class A which is put in pair with try catch final block then what happend when there come an exception in try block of Class A. then In those next steps after calling the mehod of class B, there comes an exception too, but it displays the recent exception i mean it overwrite the first exception of class B's methods m2(). And i remain unaware of actual exception that comes first.
Class A { try{ B b=new B(); b.m1(); b.m2(); } catch(Exception ex) // in catch block here what happens it display the b.m2() exception not the b.m1() exception, while i was thinking it should display first exception when it is calld at m1(); Why so ? { throw; } finally{} } class B { try { m1(){}; //here comes exception m2(){}; // it also throw some exception } catch(Exception ex) { throw; } finally { } }