Variables and Data Types – Multiple Choice Questions (MCQs)
-
-
26. What is the difference between `int` and `Integer` in Java?
-
27. What is autoboxing in Java?
-
28. What is unboxing in Java?
-
29. Which class is the wrapper class for the primitive type `boolean`?
-
30. Which class is the wrapper class for the primitive type `int`?
-
31. Which class is the wrapper class for the primitive type `double`?
-
32. What is the output of the following code? `int a = 10; Integer b = a; System.out.println(b);`
-
33. What is the output of the following code? `Integer x = new Integer(5); int y = x; System.out.println(y);`
-
34. What will be the result of `5 / 2` in Java if both operands are integers?
-
35. What will be the result of `5.0 / 2` in Java?
-
36. What will be the result of `5 / 2.0` in Java?