Java.io.Writer.write() 方法 Java.io.Writer.flush() 方法 Java.io.Writer.write char len() 方法 Java.io.Writer.write() 方法 package com.codingdict; import java.io.*; public class WriterDemo { public static void main(String[] args) { char[] c1 = {'h', 'e', 'l', 'l', 'o'}; char[] c2 = {'w', 'o', 'r', 'l', 'd'}; // create a new writer Writer writer = new PrintWriter(System.out); try { // write a char array writer.write(c1); // flush the writer writer.flush(); // write a new char array writer.write(c2); // flush the stream again writer.close(); } catch (IOException ex) { ex.printStackTrace(); } } } Java.io.Writer.flush() 方法 Java.io.Writer.write char len() 方法