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));
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? a. The value 4 is printed at the command line. b. Compilation fails because of an error in line 5. c. Compilation fails because of an error in line 9. d. A NullPointerException occurs at runtime. e. A NumberFormatException occurs at runtime. f. An IllegalStateException occurs at runtime.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
