21. public void method() {22. A a = new A();23. a.method1();24. }
1. public class A {2. public void methodl() {3. try {4. B b = new B();5. b. method2();6. /*more code here*/7. } catch (TestExcept ion te) {8. throw new RuntimeException(te);9. }6. }7. } 1. public class B {2. public void method2() throws TestException {3. /*more code here*/4. }5. } 1. public class TestException extends Exception {2. }