Exception Handling
© examsiri.com
Question : 13 of 24
Marks:
+1,
-0
Given:
Which statement is true if a TestException is thrown on line 3 of class B?
21. public void method() {
22. A a = new A();
23. a.method1();
24. }Which statement is true if a TestException is thrown on line 3 of class B?
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. }
Go to Question: