I wrote the following JAVA code in eclipse,
String s1 = "a";
String s2 = s1 + "b";
String s3 = "a" + "b";
System.out.println(s2 == "ab");
System.out.println(s3 == "ab");
The output is
false
true
why the result is like that, can some explain it to me? as I understand, both of them should be true.