public class Test{ public static void main(String[] args) { StringBuffer buffer = new StringBuffer(); buffer.append("这里"); buffer.append("是"); buffer.append("Java"); buffer.append("优才"); System.out.println("buffer=="+buffer.toString()); } }//源代码片段来自云代码http://yuncode.net