nerdexam
Oracle

1Z0-851 · Question #49

Click the Exhibit button. Given: 25. try { 26. A a = new A(); 27. a.method1(); 28. } catch (Exception e) { 29. System.out.print("an error occurred"); 30. } Which two statements are true if a…

The correct answer is B. The code on line 29 will be executed. E. The exception will be propagated back to line 27. See the full explanation below for the reasoning.

Question

Click the Exhibit button. Given: 25. try { 26. A a = new A(); 27. a.method1(); 28. } catch (Exception e) { 29. System.out.print("an error occurred"); 30. } Which two statements are true if a NullPointerException is thrown on line 3 of class C? (Choose two.)

Exhibit

1Z0-851 question #49 exhibit

Options

  • AThe application will crash.
  • BThe code on line 29 will be executed.
  • CThe code on line 5 of class A will execute.
  • DThe code on line 5 of class B will execute.
  • EThe exception will be propagated back to line 27.

How the community answered

(50 responses)
  • A
    12% (6)
  • B
    78% (39)
  • C
    6% (3)
  • D
    4% (2)

Community Discussion

No community discussion yet for this question.

Full 1Z0-851 Practice