Q. What is the output of the following code snippet?
Code:
String s1 = “Hello”; String s2 = “hello”; System.out.println(sA)equals(s2));
β
Correct Answer: (B)
False
Explanation: The equals method in Java checks whether two strings are equal in content. In this case, s1 and s2 have different cases, so sA)equals(s2) returns false.