1. ► What is the command to check version of installed java?
2. ► Which statement is true? Select one correct answer.
3. ► Which of following can be represented as literal in java?
4. ► Which reserve keyword in java is not currently in use?
5. ► Which of following is/are java reserve keywords?
6. ► 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); } }
7. ► What would be output of following program?
1 2 3 4 5 6
public class FunDo { public static void main(String[]args) { int i = 2; int j = (i = 3) * i; System.out.println(j); }}
8. ► Which of following statement is true about comments in java programming language?
/* text *///test
9. ► Selects correct declaration of array variable?
10. ► 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); }}
11. ► Java is strongly typed language, true or false?
12. ► 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); }}
13. ► Select the true statement about given code ?
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(); }}
14. ► Which statements are true about following code?
1 2 3 4 5
Class A { int x; } class B extends A { int y; }
15. ► 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()); } }
16. ► What would be output of following program?
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]); } }
17. ► What would be output of following program
public class SolArray { public static void main(String[]args) { int array1[] = { 1, 2 }; int array2[] = array1; System.out.print((array1 == array2) + " "); array1[1]++; System.out.println(array2[1]); } }
18. ► Which of following is not of integer types?
19. ► What command is the used to compile java class Solution.java?
20. ► What would be output of following program?
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); }}