Тести
Мова сайту: Українська
Українська
English
Русский
Тести з програмування
Вхід
Реєстрація
Тести з програмування
Теорія
Сніпети
Статті
Головна
Android
Ціни
FAQ
Історія Cosmo
Правила та умови сервісу
Політика конфіденційності
Політика щодо файлів cookie
Зворотній Зв’язок
boxing and unboxing
:
Мова контенту: 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
← Попередня
1
Наступна →
Зареєструйся Зараз
або
Підпишись на майбутні тести