Hi All,
The output for the below code is
BAFF.Can anybody explain me how?
class ExceptionA extends Exception {}
class ExceptionB extends ExceptionA {}
public class ObjectTest {
public static void main(
String[] args) {
try {
throw new ExceptionB();
} catch (ExceptionB b) {
System.out.print("B");
try {
throw new ExceptionB();
} catch (ExceptionA e) {
System.out.print("A");
} finally {
System.out.print("F");
}
} catch (ExceptionA a) {
System.out.print("A");
} finally {
System.out.print("F");
}
}
}
Source:TeamTesting
Thanks All