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