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
operator precedence
:
Content language: English
Русский
What will be the result of the following code execution? String s1 = "str"; String s2 = "str"; System.out.println("Result: " + s1 == s2);
operator precedence
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); } }
operator precedence
What will the following code print out? public class Main { public static void main(String[] args) { recur(99); } public static void recur(int a) { if (a <= 100) { System.out.println("a=" + a); recur(++a); System.out.println("a=" + a); } } }
operator precedence
What is the following code execution result? public static void main(String args[]) { int a = 1; int b = a++; int c = -a; System.out.print(a); System.out.print(b); System.out.print(c); }
operator precedence
Which line/lines contain an error? int i = 1; //1 i = -+(10 + 2 + i); //2 ++i--; //3 System.out.println(i);
operator precedence
What will the following code print out? public class Test { public static void main(String[] args) { int f; f = 5; f = ++f + f++; System.out.println(f); } }
operator precedence
Will the text located into conditional operator block be printed out? public static void main(String[] args){ int x = 18; int y = x++; if (x == 18 && y > 10){ System.out.println("y = " + y); System.out.println("x = " + x); } }
operator precedence
What will the following code print out? 01: public class MainClass { 02: public static void main(String[] arg) { 03: int limit = 10; 04: int sum = 0; 05: 06: int i = 1; 07: for (; i <= limit;) { 08: sum += i++; 09: } 10: System.out.println(sum); 11: } 12: }
operator precedence
What will be displayed in the console? public class StringTest { public static void main(String[] args) { int result = 12 + 2 * 5 % 3 - 15 / 4; String x = 12 - 6 + "Hello" + 7 + 5; System.out.println(result + " - " + x); } }
operator precedence
What is the result of the following code: public class MainClass { public static void main(String args[]) { int k = 2; int m = 10; int s = 1 >> k++ + ++m - --k - m-- << 1; System.out.println("s = " + s); System.out.println("k = " + k); System.out.println("m = " + m); } }
operator precedence
← Prev
1
2
Next →
Sign Up Now
or
Subscribe for future quizzes