Java.io.StringWriter.write Char() 方法 Java.io.StringWriter.toString() 方法 Java.io.StringWriter.write() 方法 Java.io.StringWriter.write Char() 方法 package com.codingdict; import java.io.*; public class StringWriterDemo { public static void main(String[] args) { char c = 'b'; // create a new writer StringWriter sw = new StringWriter(); // write chars sw.write('a'); sw.write(c); // print result by converting to string System.out.println("" + sw.toString()); } } Java.io.StringWriter.toString() 方法 Java.io.StringWriter.write() 方法