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
operators
:
Content language: English
Русский
What will be printed out as a result of the following code execution / compilation? public class Test { public static void main(String[] args) { ElectricInverter inverter = new ElectricInverter(); int AC = 220; System.out.println(inverter.invert(AC)); } } class ElectricInverter { public static final int AC = ~220; public static final int DC = -110; public static final int GROUND = 0; int invert(int type) { if (type == AC) { return DC; } else if (type == DC) { return AC; } return GROUND; } }
operators
What will be the result of the compilation and execution of the following code: interface I { public final static int EASY = 5; } public class Main implements I { public static void main(String[] args) { int a = 5; test(++a); } static void test(int a) { a += EASY + a++; System.out.println(a); } }
operators
What will be the result of the following code execution? String s1 = "str"; String s2 = "str"; System.out.println("Result: " + s1 == s2);
operators
What will be printed out as a result of the following code execution? public class MathTest { public static void main(String... args) { System.out.println((-7 % 5) > (7 % -5)); System.out.println(Math.abs(Math.ceil(-2.5)) < Math.ceil(Math.abs(-2.5))); } }
operators
Is it possible to overload operators in Java?
operators
What will be the result of the following code execution: String s1 = "abc"; String s2 = new String("abc"); String s3 = "abc"; System.out.println(s1 == s2); System.out.println(s1 == s3); System.out.println(s1 == "abc");
operators
What will be displayed, if the following code is compiled and executed: public class Main { public static void main(String args[]) { System.out.println("2 + 2 = " + 2 + 2); } }
operators
What will be the result of the following program execution? public class Test { public static void main(String[] args) { Integer i1 = 1000; Integer i2 = 1000; System.out.println(i1 == i2); System.out.println(i1 == 1000); } }
operators
What is the result of the following program execution? class MyLink { public MyLink() { str = "New"; } public String str; } public class Test { public static void main(String[] args) { MyLink b1 = new MyLink(); MyLink b2 = b1; b2.str = "My String"; System.out.println(b1.str); String a1 = "Test"; String a2 = a1; System.out.println(a2); a1 = "Not a Test"; System.out.println(a2); } }
operators
What will be the result of the following code execution? public class Main { public static void main(String[] args) { int i = 0; int j = 1; System.out.println(i += (j < i) ? (2) : (3)); //1 } }
operators
← Prev
1
2
3
4
5
Next →
Sign Up Now
or
Subscribe for future quizzes