This is because the arguments of
Java method calls are passed by
value. Here, the value of s1 ie. the reference to the object of new StringBuffer("s1") not the object, is passed to the method.
In the method b1, the reference, is changed not s1.
That is, s1 remains the same.