Oracle
1Z0-851 · Question #144
Given: 31. //some code here line 31 32. try { 33. //some code here line 33 34. } catch (NullPointerException e1) { 35. //some code here line 35 36. } finally { 37. //some code here line 37 38. }…
The correct answer is B. The code on line 33 throws an exception. C. The code on line 35 throws an exception. E. The code on line 33 executes successfully. See the full explanation below for the reasoning.
Question
Given: 31. //some code here line 31 32. try { 33. //some code here line 33 34. } catch (NullPointerException e1) { 35. //some code here line 35 36. } finally { 37. //some code here line 37 38. } Under which three circumstances will the code on line 37 be executed? (Choose three.)
Options
- AThe instance gets garbage collected.
- BThe code on line 33 throws an exception.
- CThe code on line 35 throws an exception.
- DThe code on line 31 throws an exception.
- EThe code on line 33 executes successfully.
How the community answered
(44 responses)- A14% (6)
- B80% (35)
- D7% (3)
Community Discussion
No community discussion yet for this question.