Тесты
Язык сайта: Русский
Українська
English
Русский
Тесты по программированию
Вход
Регистрация
Тесты по программированию
Теория
сниппеты
Статьи
Главная
Android
Цены
FAQ
История Cosmo
Правила и условия сервиса
Политика конфиденциальности
Политика в отношении файлов cookie
Обратная Связь
initialization
:
Язык контента: English
Русский
What will the following code display? class Quizful { private static int count = 0; private final int id = ++count; private void print() { System.out.println(id); } public void printOther(Quizful other) { other.print(); } public static void main(String[] args) { Quizful one = new Quizful(); Quizful two = new Quizful(); two.printOther(one); } }
initialization
What is the result of the following code compilation? class Quest3 { public static void main(String s[ ]) { String args; System.out.print(args + s); } }
initialization
What changes will lead to a successful compilation of the following code? Select all that apply. public class LocalVsInstance { String s; public static void main(String[] args) { String s; System.out.println(s.toUpperCase()); LocalVsInstance localVsInstance = new LocalVsInstance(); System.out.println(localVsInstance.s.toUpperCase()); } }
initialization
What is the result of the following code execution? public class Test { static { i = 5; } static int i = 6; public static void main(String[] args) { System.out.println(i); } }
initialization
What will be displayed after the following code execution? public class Tasks { public static Tasks instance = new Tasks(); private static final int DELTA = 5; private static int BASE = 7; private int x; public Tasks() { x = BASE + DELTA; } public static void main(String[] args) { System.out.println(Tasks.instance.x); } }
initialization
What will be printed out as a result of the following code compilation and execution? public class A { { System.out.println("one"); } public static void main(String[] args) { System.out.println("two"); } static { System.out.println("three"); } }
initialization
What will the following code display (ASCII code of '1' is 49)? public class Test { public static void main(String[] args) { char c1 = '1'; char c2 = '\u0031'; char c3 = 49; System.out.println(c1 + c2 + c3); } }
initialization
What will be the result of the following code compilation and execution? public class Main { public static void main(String args[]) { ClassA a = new ClassA(); a.methodA(); } } class ClassA { public void methodA(){ ClassB classB = new ClassB(); System.out.println(classB.getValue()); } } class ClassB { public ClassC classC; public String getValue() { return classC.getValue(); } } class ClassC { public String value; public String getValue() { value = "ClassC"; return value; } }
initialization
What will be printed out to console as a result of the following code execution? public class Clazz { public static void main(String[] args) { int a = 0; System.out.println("a=" + new Integer(a = 1)); } }
initialization
What will the following code print out to console? public class Test { private Integer k; private int z; private int i; public void method() { i = k + z; // 1 } public static void main(String[] args) { Test t = new Test(); t.method(); System.out.println(t.i); // 2 } }
initialization
← Предыдущая
1
2
3
4
5
Следующая →
Зарегистрируйся сейчас
или
Подпишись на будущие тесты