Hi
Let's take ur code in some depth u 've two StringBuffer objects. n there handeles r a and b in main method(I will call them amain and bmain).
U passed the references(handeles) of these objects to a method sweep .
Method Sweep has its own references but towards those Objects creadted in main method.
now when u change the object referred by a(of sweep) it actually changes the Actual object.
but when u excute a=b; u actually shifts the reference of bsweep from the object in main.
That's why "b is Two " printed.
If u 've any more query abt. this u can mail me personnaly at
[email protected] Regards