Challenge - 5 Problems
Unboxing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 code output
intermediate2:00remaining
What is the output of this unboxing example?
Consider the following Java code. What will be printed when it runs?
Java
Integer a = 1000; int b = a; System.out.println(b == a);
Attempts:
2 left
💻 code output
intermediate2:00remaining
What is the output when comparing Integer objects with ==?
What will this Java code print?
Java
Integer x = 127; Integer y = 127; System.out.println(x == y); Integer m = 128; Integer n = 128; System.out.println(m == n);
Attempts:
2 left
🔧 debug
advanced2:00remaining
Identify the runtime error caused by unboxing
What error will this code produce when run?
Java
Integer a = null; int b = a; System.out.println(b);
Attempts:
2 left
💻 code output
advanced2:00remaining
What is the output of this mixed boxing and unboxing code?
Analyze the output of this Java code snippet:
Java
Integer i = 10; int j = 10; System.out.println(i.equals(j)); System.out.println(i == j);
Attempts:
2 left
🧠 conceptual
expert3:00remaining
How many Integer objects are created in this code?
Consider this Java code snippet. How many distinct Integer objects are created during execution?
Java
Integer a = 100; Integer b = 100; Integer c = new Integer(100); Integer d = Integer.valueOf(100); Integer e = 200; Integer f = 200;
Attempts:
2 left
