Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
boxing and unboxing
:
Content language: English
Русский
What number of different objects will variables b1 - b11 refer to after the following code execution? Boolean b1 = true; Boolean b2 = true; Boolean b3 = true; Boolean b4 = true; Boolean b5 = true; Boolean b6 = true; Boolean b7 = true; Boolean b8 = true; Boolean b9 = new Boolean(true); Boolean b10 = new Boolean(true); Boolean b11 = new Boolean(true);
boxing and unboxing
What will be the result of the following code execution? public class StartClass { public static void main(String[] args) { Double d1 = 1d; Double d2 = 1d; System.out.println(d1 == d2); } }
boxing and unboxing
What is the following code execution result? Integer i1 = 10; Integer i2 = 10; Double d1 = 10d; Double d2 = 10d; System.out.println(i1 == i2); System.out.println(d1 == d2);
boxing and unboxing
Will the code compile? If so, what will be the result of its implementation? public class Autoboxing { public static void main(String[] args) { Integer oInt1 = null; Integer oInt2 = 0; final int int1 = oInt1; final int int2 = oInt2; System.out.println(int1 == int2); } }
boxing and unboxing
Among the snippets of code below choose all that will compile successfully.
boxing and unboxing
What will be the result of compilation and execution of the following code? public class Test { static void methodA(Long l) { System.out.println(l); } static void methodB(Object o) { Byte b = (Byte) o; System.out.println(b); } public static void main(String[] args) { byte b = 5; methodA(b); // 1 methodB(b); // 2 } }
boxing and unboxing
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes