Introduction to Java – Multiple Choice Questions (MCQs)
-
-
26. Which operator is used for assignment in Java?
-
27. What is the output of `System.out.println(Hello" + "World");`?"
-
28. What is the output of `System.out.println(5 == 5.0);`?
-
29. What is the output of `System.out.println(5 === 5.0);`?
-
30. Which of the following is NOT a valid identifier in Java?
-
31. What is the purpose of the `package` keyword in Java?
-
32. Which keyword is used to import classes from other packages?
-
33. What is the default package in Java?
-
34. Which class is the ultimate superclass of all classes in Java?
-
35. What is the role of the garbage collector in Java?
-
36. What is the output of `System.out.println(2 << 2);`?