Java StringBuffer类 使用valueOf()进行Java数据转换 Java toString() 方法 Java StringBuffer类 import java.lang.*; public class StringBufferDemo { public static void main(String[] args) { StringBuffer buff = new StringBuffer("tuts "); System.out.println("buffer = " + buff); // appends the boolean argument as string to the string buffer buff.append(true); // print the string buffer after appending System.out.println("After append = " + buff); buff = new StringBuffer("abcd "); System.out.println("buffer = " + buff); // appends the boolean argument as string to the string buffer buff.append(false); // print the string buffer after appending System.out.println("After append = " + buff); } } 使用valueOf()进行Java数据转换 Java toString() 方法