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