Тесты
Язык сайта: Русский
Українська
English
Русский
Тесты по программированию
Вход
Регистрация
Тесты по программированию
Теория
сниппеты
Статьи
Главная
Android
Цены
FAQ
История Cosmo
Правила и условия сервиса
Политика конфиденциальности
Политика в отношении файлов cookie
Обратная Связь
initialization
:
Язык контента: English
Русский
Which line/lines will compilation error occur in? public class Test { public static void main(String[] args) { char c = (char) 1; // 1 boolean boo = (boolean) 1; // 2 byte b = (byte) true; // 3 } }
initialization
What will be printed after the following code is executed? public class Main { public static void main(String[] args) { String strA = "text"; String strB = "text"; strA += "1"; strB += "1"; System.out.println(strA != strB); strA = "text1"; strB = "text1"; System.out.println(strA != strB); } }
initialization
What will be printed out to console after the following class is compiled and executed: public class A { public static void main(String[] args) { List<Integer> list = new ArrayList<Integer>(); list.add(1); list.add(0); Integer[] array = null; list.toArray(array); System.out.println(list.get(1)); } }
initialization
What is the result of the following code execution? public class Main { static class X { static String x = Y.y; } static class Y { static String y = X.x; } public static void main(String[] args) { Y.y = "0"; System.out.println(X.x); } }
initialization
What is the following program`s execution result? class Tack { static short s = 17; public Tack(short ss) { new Tack(); s *= ss; } public Tack() { ; } } public class Bridle extends Tack { public Bridle(int s) { System.out.println(s + 1); } public static void main(String[] args) { Bridle b = new Bridle(3); } }
initialization
What will the following code print? public class A { int a; //--1-- public short getB() { short b; //--2-- return b; //--3-- } public static void main(String[] args) { System.out.print(new A().a); // --4-- System.out.println(new A().getB()); } }
initialization
What is the following code execution result? String data[]; data = {"one", "two", "three"}; System.out.println(data[1]);
initialization
What will be the result of compiling and running this code? public class Sentence { public static void main(String[] args) { String str1 = "Zero"; String str2 = "Zero"; boolean b1; if (str1 == str2) b1 = true; else b1 = false; System.out.println(b1); String str3 = "Zero"; String str4 = "Zero1"; boolean b2; if (str3 == str4) b2 = true; else b2 = false; System.out.println(b2); } }
initialization
After performance of what line, only one object will be available for the garbage collection (Garbage Collection)? 01. public class Test { 02. Test ags = null; 03. public static void main(String argv[]) { 04. Test a1 = new Test(); 05. Test a2 = new Test(); 06. Test a3 = new Test(); 07. a1.ags = new Test(); 08. a2.ags = a1.ags; 09. a3.ags = a2.ags; 10. a1 = null; 11. a2 = null; 12. a3 = null; 13. } 14. }
initialization
What will be displayed by the following program? public class Main { { System.out.print("1 "); } Main(){ System.out.print("2 "); } public static void main(String[] args) { System.out.print("3 "); Main m = new Main(); System.out.print("4 "); } static { System.out.print("5 "); } }
initialization
← Предыдущая
1
2
3
4
5
Следующая →
Зарегистрируйся сейчас
или
Подпишись на будущие тесты