What will be the output of the following code snippet?
Additional Details
Object s1 = new String(“Hello”);
Object s2 = new String(“Hello”);
if(s1 == s2) {
System.out.println(“s1 and s2 are ==”);
}else if (s1.equals(s2)) {
System.out.println(“s1 and s2 are equals()”);
}
Answer:
s1 and s2 are equals()
What is the output of the following code snippet?
Read more: Heaviest noble gas