Q. What is the output of the following code snippet?
Code:String s1 = “Hello”; String s2 = “hello”; System.out.println(sA)equalsIgnoreCase(s2));
β
Correct Answer: (A)
True
Explanation: The equalsIgnoreCase method in Java checks whether two strings are equal in content, ignoring differences in case. In this case, s1 and s2 have different cases, but sA)equalsIgnoreCase(s2) returns true because the comparison is case-insensitive.