public class ConcatenationRuntime {
public static void main(String[] args) {
String s1 = "jim";
String s3 = "j";
String im = "im";
s3=s3+= im;
System.out.println("s3> " +s3); // jim
System.out.println(s1==s3); // line 8
System.out.println("Hel" + "lo" == "Hello"); // true
}
}
Why it is printing false on line 8? These are all literals, and two references should point to the same literal in the pool - I'm a bit confused.