Тести
Мова сайту: Українська
Українська
English
Русский
Тести з програмування
Вхід
Реєстрація
Тести з програмування
Теорія
Сніпети
Статті
Головна
Android
Ціни
FAQ
Історія Cosmo
Правила та умови сервісу
Політика конфіденційності
Політика щодо файлів cookie
Зворотній Зв’язок
operators
:
Мова контенту: English
Русский
Which of these lines contains a valid code: public class Test { public static void main(String[] sr) { int x, y, z; x = 1; y = 2; z = 3; System.out.println(z >= y >= x); //1 System.out.println(z >= y && y >= x); //2 } }
operators
What will the following code print out: public class Test { public static boolean methodOne() { System.out.println("methodOne "); return false; } public static boolean methodTwo() { System.out.println("methodTwo "); return true; } public static boolean methodThree() { System.out.println("methodThree "); return true; } public static void main(String[] args){ System.out.println(Test.methodOne() || Test.methodTwo() || Test.methodThree()); } }
operators
That will the following code display on the screen: class Main { public static void main(String[] args) { int i = 0; System.out.println(++i == i++); System.out.println(i++ == i++); } }
operators
What will be the result of the following program execution? public class Test { private void method1() { MyClass obj = new MyClass(); obj.x = 1; method2(obj); System.out.println("obj.x="+obj.x); } private void method2(MyClass param) { param.x = 2; param = new MyClass(); param.x = 3; } class MyClass { int x; } public static void main(String[] args) { new Test().method1(); } }
operators
What should be placed instead of ... in order to get a "I will be a good citizen." result? public class Test { public static void main(String[] args) throws Exception { boolean toBe = ... PrinceOfDenmark hamlet = new PrinceOfDenmark(); hamlet.tortureYourSelf((toBe || !toBe)); } } class PrinceOfDenmark { void tortureYourSelf(boolean mind) { if (mind) { System.out.println("I will hate everybody including myself!"); } else { System.out.println("I will be a good citizen."); } } }
operators
What will be printed to console during the following expression calculation? int x = 0; System.out.print(++x==x++);
operators
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); } }
operators
What will be the result of the following code compilation and execution? public class Test { public static void main(String[] args) { byte a = 3; short b = 4; compute(a, b); } public static void compute(short x, short y) { System.out.println("Short: " + (x + y) + (x + y)); } }
operators
What will the following code;s execution display? class V { String s = null; V(String str){ this.s = str; } } public class MyTest { public static void main(String[] args) { V v1 = new V("abc"); V v2 = new V("abc"); System.out.println((v1 == v2) + " " + v1.equals(v2)); } }
operators
What is the result of the following code compilation and execution? public class A { public static void main(String[] args) { for (int i = 0; ++i > 0;) { System.out.println(i); } } }
operators
← Попередня
1
2
3
4
5
Наступна →
Зареєструйся Зараз
або
Підпишись на майбутні тести