String s1 = "S1";
String s2 = "S1";
System.out.print("," + (s1==s2));//returns true.
but then when i assign, s1="S2";
then the answer is false.
But how is that possible, here s1 and s2 are pointing to the same String objects(S1), so any change made to s1 should affect the value of s2 as weel, but that is not the case, why???