Java.io.PrintWriter.print Char() 方法


Java.io.PrintWriter.print Char() 方法

package com.codingdict;



import java.io.*;



public class PrintWriterDemo {



   public static void main(String[] args) {

      char c = 'a';



      // create a new writer

      PrintWriter pw = new PrintWriter(System.out);



      // print chars

      pw.print(c);



      // change line

      pw.println();



      // print another char

      pw.print('b');



      // flush the writer

      pw.flush();

   }

}