tg-me.com/topJavaQuizExplain/111
Last Update:
What is printed besides the stack trace caused by the NullPointerException from line 16?
❌ A. AE
❌ B. AEBCD
✅ C. AEC
❌ D. AECD
❌ E. No output appears other than the stack trace
Explanation:
The main() method invokes go and A is printed on line 3. The stop method is invoked and E is printed on line 14. Line 16 throws a NullPointerException, so stop immediately ends and line 17 doesn’t execute. The exception isn’t caught in go, so the go method ends as well, but not before its finally block executes and C is printed on line 9. Because main() doesn’t catch the exception, the stack trace displays and no further output occurs, so AEC was the output printed before the stack trace.
BY Explanations “Top Java Quiz Questions”
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
Share with your friend now:
tg-me.com/topJavaQuizExplain/111