参考资料:http://blog.sina.com.cn/s/blog_59ca2c2a0100qhjx.html
http://blog.csdn.net/a412588063/article/details/8782742
实例解析:
1 public class Test{ 2 public static void main(String[] args){ 3 StringBuffer a=new StringBuffer("A"); 4 StringBuffer b=new StringBuffer("B"); 5 operate(a,b); 6 System.out.println(a+","+b); 7 } 8 static void operate(StringBuffer x,StringBuffer y){ 9 x.append(y); 10 y=x; 11 } 12 }
图片解析: