Introduction to Java – Multiple Choice Questions (MCQs)
-
-
14. Which of the following is a multi-line comment in Java?
-
15. What is the purpose of `System.out.println()`?
-
16. What is the output of `System.out.println(2 + 3 * 4);`?
-
17. Which of the following is a primitive data type in Java?
-
18. Which of the following is a reference data type in Java?
-
19. What is the default value of an integer variable in Java?
-
20. What is the default value of a boolean variable in Java?
-
21. What is the default value of a reference variable in Java?
-
22. Which keyword is used to declare a constant variable in Java?
-
23. What is the output of `System.out.println(5 / 2);`?
-
24. What is the output of `System.out.println(5 % 2);`?