nerdexam
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

1Z0-851 question #108 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)
  • A
    3% (1)
  • B
    70% (21)
  • C
    10% (3)
  • D
    17% (5)

Community Discussion

No community discussion yet for this question.

Full 1Z0-851 Practice