



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




#include
class A extends Exception { } class B extends A { } class C extends B { } class D extends A { } class E extends D { } class MAIN { static void F (boolean x) throws A { try { System.out.println(1); G(x); System.out.println(2); } catch (B b) { System.out.println(3); } catch (D d) { System.out.println(4); } catch (A a) { System.out.println(5); } finally { System.out.println(6); if (x) throw new E( ); System.out.println(7); } } static void G (boolean y) throws A { try { System.out.println(8); H(y); System.out.println(9); } catch (E e) { System.out.println(10); } catch (D d) { System.out.println(11); } catch (A a) { System.out.println(12); } finally { System.out.println(13); if (y) throw new C( ); System.out.println(14); } } static void H (boolean z) throws A { try { System.out.println(15); if (z) throw new B( ); System.out.println(16); } catch (C c) { System.out.println(17); } catch (B b) { System.out.println(18); } catch (A a) { System.out.println(19); } finally { System.out.println(20); if (z) throw new D( ); System.out.println(21); } } public static void main (String[ ] args) { try { System.out.println(22); F(true); System.out.println(23); } catch (D d) { System.out.println(24); } catch (B b) { System.out.println(25); } catch (A a) { System.out.println(26); } finally { System.out.println(27); } } }