Java.io.PrintWriter.checkError() 方法


Java.io.PrintWriter.checkError() 方法

package com.codingdict;



import java.io.*;



public class PrintWriterDemo {



   public static void main(String[] args) {

      String s = "Hello World ";



      // create a new stream at system

      PrintWriter pw = new PrintWriter(System.out);



      // append the sequence

      pw.append(s);



      // check if there is an error and flush

      System.out.println("" + pw.checkError());

   }

}