Challenge - 5 Problems
Autoboxing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 code output
intermediate2:00remaining
What is the output of autoboxing with == operator?
Consider the following Java code snippet. What will be printed when it runs?
Java
Integer a = 1000; Integer b = 1000; System.out.println(a == b);
Attempts:
2 left
💻 code output
intermediate2:00remaining
What is the output when adding Integer and int?
What will the following Java code print?
Java
Integer x = 5; int y = 10; System.out.println(x + y);
Attempts:
2 left
🔧 debug
advanced2:00remaining
Why does this code throw NullPointerException?
Examine the code below. Why does it throw a NullPointerException at runtime?
Java
Integer a = null; int b = a; System.out.println(b);
Attempts:
2 left
🧠 conceptual
advanced2:00remaining
How does autoboxing affect performance?
Which statement best describes the performance impact of autoboxing in Java?
Attempts:
2 left
💻 code output
expert2:00remaining
What is the output of this tricky autoboxing and caching code?
Analyze the code below and select the output it produces.
Java
Integer i1 = 127; Integer i2 = 127; Integer i3 = 128; Integer i4 = 128; System.out.println(i1 == i2); System.out.println(i3 == i4);
Attempts:
2 left
