Time left:

[All Quizzes] → [Programming With Java] → [Language Fundamentals]


1. ► Select declaration where array objects are created?

A.
B.
C.
D.
E.

2. ► Java is strongly typed language, true or false?

A.
B.

3. ► What would be output of following program?

1
2
3
4
5
6
7
8
9
public class SolArray {
    public static void main(String[]args) {
        int array[][] = { {1, 2}, null };

      for (int[]arr:array)
          for (int x:arr)
                System.out.println(x);
    }
}
A.
B.
C.
D.
E.

4. ► Which of following is not of integer types?

A.
B.
C.
D.
E.

5. ► Select option(s) which represent output of following program.

1
2
3
4
5
6
7
8
9
10
11
public class SolArray {
    public static void main(String[]args) {
        int array1[] = { 1, 2 };

        int array2[] = array1;

        System.out.println(array1.getClass());
        System.out.println(array1.getClass().getSuperclass());

    }
}
A.
B.
C.
D.
E.

6. ► What will be the output of following program?

1
2
3
4
5
6
7
8
9
10
public class Fun {
    public static void main(String[]args) {
        int i = 0;
         System.out.print(i++ + " " + ++i);
         i = ++i;
         System.out.print(i);



}}
A.
B.
C.
D.
E.

7. ► What would be output of following program?

1
2
3
4
5
6
7
8
9
10
public class SolArray {
    public static void main(String[]args) {
        int array1[] = { 1, 2 };

        int array2[] = array1;

        System.out.println(array1[0] == array2[0]
                           && array1[1] == array2[1]);
    }
}
A.
B.
C.
D.
E.

8. ► What is the command to check version of installed java?

A.
B.
C.
D.
E.

9. ► What command is the used to compile java class Solution.java?

A.
B.
C.
D.
E.

10. ► Choose correct option about Arrays in java?

A.
B.
C.
D.
E.

11. ► What would be output of following program?

1
2
3
4
5
6
7
public class FunOp {
    public static void main(String[]args) {
        int x = 3, y = 5;
        int a = x + y - x / y + 2;
        int b = (x + y) - x / (y + 2);
         System.out.println(a + b);
}}
A.
B.
C.
D.
E.

12. ► What would be output of following program?

1
2
3
4
5
6
7
public class FunOp {
    public static void main(String[]args) {
        int x = 3, y = 5;
        int a = x + y - x / y + 2;
        int b = (x + y) - x / (y + 2);
         System.out.println("a=" + a + " " + "b=" + b);
}}
A.
B.
C.
D.
E.

13. ► Which statement(s) is true about java?

A.
B.
C.
D.
E.

14. ► What would be output of following program?

1
2
3
4
5
6
7
8
9
10
class Solution {
    public static void main(String[]args) {
        int[] array = new int[101];
        for (int i = 0; i < array.length; i++)
             array[i] = i;
        int sum = 0;
        for (int x:array)
             sum += x;
         System.out.println(sum);
}}
A.
B.
C.
D.
E.

15. ► What would be output of following program?

1
2
3
4
5
6
7
8
9
10
public class FunDo {
    public static void main(String[]args) {
        int x = 9;
         x += (x = 3);
         System.out.print(x);
        int y = 9;
         y = y + (y = 3);
         System.out.print(" ");
         System.out.println(y);
}}
A.
B.
C.
D.
E.

16. ► What will be hex value of integer value 2013?

A.
B.
C.
D.
E.

17. ► Which of following can be represented as literal in java?

A.
B.
C.
D.
E.

18. ► What command should be used to execute main method of class Solution?

A.
B.
C.
D.
E.

19. ► Which statement is/are true about object?

A.
B.
C.
D.
E.

20. ► Select the true statement about given code ?

1
2
3
4
5
6
class Solution {
    public static void main(String[]args) {
        for (int i = 0; i < args.length; i++)
            System.out.print(i == 0 ? args[i] : " " + args[i]);
        System.out.println();
}}
A.
B.
C.
D.
E.


© 2016 VirtuQ™ Education All right reserved. | Terms of Use | Privacy Policy