hi,I meet a interesting question about this
string buffer,why this output is "Hello how are you",but not "doing"? I'm confused about it.
public class TestBuffer {
public void myBuf( StringBuffer s2, StringBuffer s3) {
s2.append(" how are you") ;
s2 = s3;
}
public static void main ( String args[] ) {
TestBuffer tb = new TestBuffer();
StringBuffer s = new StringBuffer("Hello");
StringBuffer s1 = new StringBuffer("doing");
tb.myBuf(s, s1);
System.out.print(s);
}
}