Oracle
1Z0-851 · Question #108
Click the Exhibit button. Given: public void method() { A a = new A(); a.method1(); } Which statement is true if a TestException is thrown on line 3 of class B?
The correct answer is B. The exception thrown by method1 in class A is not required to be caught. See the full explanation below for the reasoning.
Question
Click the Exhibit button. Given: public void method() { A a = new A(); a.method1(); } Which statement is true if a TestException is thrown on line 3 of class B?
Exhibit
Options
- ALine 33 must be called within a try block.
- BThe exception thrown by method1 in class A is not required to be caught.
- CThe method declared on line 31 must be declared to throw a RuntimeException.
- DOn line 5 of class A, the call to method2 of class B does not need to be placed in a try/catch block.
How the community answered
(30 responses)- A3% (1)
- B70% (21)
- C10% (3)
- D17% (5)
Community Discussion
No community discussion yet for this question.
