Oracle
1Z0-851 · Question #184
1Z0-851 Question #184: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #184. The question stem and answer options stay visible for context.
Question
Given: public class Boxer1{ Integer i; int x; public Boxer1(int y) { x = i+y; System.out.println(x); } public static void main(String[] args) { new Boxer1(new Integer(4)); } } What is the result?
Options
- AThe value "4" is printed at the command line.
- BCompilation fails because of an error in line 5.
- CCompilation fails because of an error in line 9.
- DA NullPointerException occurs at runtime.
- EA NumberFormatException occurs at runtime.
- FAn IllegalStateException occurs at runtime.
Unlock 1Z0-851 to see the answer
You've previewed enough free 1Z0-851 questions. Unlock 1Z0-851 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.