I was studying Kathy Sierra Java book. I came across one question something like this:
public class A {
public static void main(String args[]){
S
s2 is a reference to s1 in the first case. In the second case, + is translated to s1.concat("d") which creates a new string, so the references s1 and s2 point to different string objects.
In the case of StringBuffer, the reference never changes. append changes the internal structure of the buffer, not the reference to it.