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
initialization
:
Content language: English
Русский
What will be printed out as a result of the following code execution / compilation? class A { public A() { System.out.print("A"); } } class B { public B() { System.out.print("B"); } } class C { public C() { System.out.print("C"); } } public class D extends C { private A objA = new A(); private static B objB = new B(); public D() { System.out.print("D"); } public static void main(String[] args){ new D(); } }
initialization
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); } }
initialization
What is the result of the following code execution? import java.util.Arrays; class Generic<T extends Number> { private T arr[] = {1, 2, 3, 4, 5}; public String toString(){ return Arrays.toString(arr); } } public class Test { public static void main(String [] args) { Generic<Double> obj = new Generic<Double>(); System.out.println(obj); } }
initialization
What will be printed out to console? public class A { public static void main(String[] sr) { int a = 010; System.out.println(a); } }
initialization
int[] x = new int[25] Which of statements below are true?
initialization
What will the following code.s execution print to console? public class Test { static int b = Test.a; static final int a = 3; public static void main(String... args) { System.out.println("a = " + a + ", b = " + b); } }
initialization
Can the main method be declared as final?
initialization
Which definitions of the MyInterface interface are correct?
initialization
What number of different objects will variables b1 - b11 refer to after the following code execution? Boolean b1 = true; Boolean b2 = true; Boolean b3 = true; Boolean b4 = true; Boolean b5 = true; Boolean b6 = true; Boolean b7 = true; Boolean b8 = true; Boolean b9 = new Boolean(true); Boolean b10 = new Boolean(true); Boolean b11 = new Boolean(true);
initialization
What will happen after the code is compiled and program is run without arguments? public class Main { public static void main(String[] args) { System.out.println(args.length); } }
initialization
← Prev
1
2
3
4
5
Next →
Sign Up Now
or
Subscribe for future quizzes