assigns sb with the new reference, but it will not make the sb becomes "Hai" because you only pass in the copy of the reference and not the original reference.
So, in conclusion, the answer is "String Buffer added".
Hope it's clear enough for you.
SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
Joined: Jul 23, 2007
To add another prespective when you are calling the method you have passed the refrence pointing to the object in the main and appended it with string "Added".
Than you assigned new object to the refrence in the scope of the method therefore when you come out of the method's scope this object will be elligible for the GC and when you SOP in main it will print the value of the object created in the main and appended in the method call.
You can draw the object to make yourself clear or if you face any problem post it here. [ October 04, 2007: Message edited by: subodh gupta ]