Variables and Data Types – Multiple Choice Questions (MCQs)
-
-
38. Is `String` a primitive or reference data type in Java?
-
39. Are Strings mutable or immutable in Java?
-
40. How do you declare and initialize a String variable in Java?
-
41. What is string concatenation in Java?
-
42. Which operator is used for string concatenation in Java?
-
43. What will be the output of `Hello" + "World"` in Java?"
-
44. What is the purpose of the `StringBuilder` class in Java?
-
45. What is the purpose of the `StringBuffer` class in Java?
-
46. What is an array in Java?
-
47. How do you declare an integer array of size 5 in Java?
-
48. How do you access the first element of an array named `myArray` in Java?