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
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)- A12% (6)
- B78% (39)
- C6% (3)
- D4% (2)
Community Discussion
No community discussion yet for this question.
