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
numbers
:
Content language: English
Русский
Mark the answer choices in which the pairs are equal to each other (2 correct answers):
numbers
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))); } }
numbers
What is the following program output: class Main { public static void main(String[] args) { switch (new Integer(4)) { case 4: System.out.println("4"); break; default: System.out.println("default"); } } }
numbers
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); } }
numbers
What is the result of the following code compilation and execution: class Quizful { private Double x = 2; public static void multX(Quizful q, Double n) { q.setX(q.getX() * n); } public Double getX() { return x; } public void setX(Double x) { this.x = x; } public static void tripleValue(Double x) { x *= 3; } public static Quizful resetX(Quizful q) { q = new Quizful(); return q; } public static void main(String[] args) { Double x = 4; tripleValue(x); Quizful q = new Quizful(); multX(q,x); resetX(q); System.out.print(q.getX()); } }
numbers
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); } }
numbers
Which of the following pieces of code are considered to be a correct Java code?
numbers
What happens when you run the following program? class TestClass { int i = getInt(); int k = 20; public int getInt() { return k+1; } public static void main(String[] args) { TestClass t = new TestClass(); System.out.println(t.i + " " + t.k); } }
numbers
What will be the result of the following code execution? public class Test { public static void main(String args[]) { byte a = 1; byte b = ++a; byte c = -a; System.out.print(a); System.out.print(b); System.out.print(c); } }
numbers
What will be the result of the following program compilation and execution? public class Test { public static void main(String[] args) { int myInt = 0; float myFloat = 0; try { float result = myFloat / myFloat; } catch (RuntimeException re) { System.out.println("Exception 1"); } try { float result = myFloat / myInt; } catch (RuntimeException re) { System.out.println("Exception 2"); } try { float result = myInt / myFloat; } catch (RuntimeException re) { System.out.println("Exception 3"); } try { float result = myInt / myInt; } catch (RuntimeException re) { System.out.println("Exception 4"); } } }
numbers
← Prev
1
2
3
4
5
Next →
Sign Up Now
or
Subscribe for future quizzes