首页 > 代码库 > Java中的StringBuffer

Java中的StringBuffer

Java中的StringBuffer


/**
 * 
 */
package com.you.model;

/**
 * @author YouHaidong
 *
 */
public class StrFoo 
{
	/**
	 * @param args
	 */
	public static void main(String[] args) 
	{
        StringBuffer a = new StringBuffer("A");
        StringBuffer b = new StringBuffer("B");
        operate(a, b);
        System.out.println(a + "," + b);
	}
	
	/**
	 * 
	 * @param x
	 * @param y
	 */
	public static void operate(StringBuffer x,StringBuffer y)
	{
		x.append(y);
		y = x;
	}

}

运行结果:

AB,B