Q. What is the output of the following code snippet?
Code:
String s1 = “Hello”; System.out.println(sA)toUpperCase());
β
Correct Answer: (A)
HELLO
Explanation: The toUpperCase method in Java returns a new string that is the original string with all lowercase letters converted to uppercase. In this case, sA)toUpperCase() returns “HELLO”.