About Question com.enthuware.jfcja.v8.2.474 :
Posted: Wed Jan 27, 2021 4:57 am
I believe this should read "Which of the following options are valid, if added independently?"
This answer is easy because only one is not a proper operator for String class.
However, in the explanation of what is printed. s1 == s2 is only false if this is independent of the previous println s1 = s2
If the lines are added cumulatively,
String s1 = "Hello";
String s2 = "World";
s1 += s2;
System.out.println(s1 = s2); //World
System.out.println(s1 == s2); //true
System.out.println(s1.equals(s2)); //true
}
This answer is easy because only one is not a proper operator for String class.
However, in the explanation of what is printed. s1 == s2 is only false if this is independent of the previous println s1 = s2
If the lines are added cumulatively,
String s1 = "Hello";
String s2 = "World";
s1 += s2;
System.out.println(s1 = s2); //World
System.out.println(s1 == s2); //true
System.out.println(s1.equals(s2)); //true
}