Java.io.PrintWriter.print Boolean() 方法 Java.io.PrintWriter.format String() 方法 Java.io.PrintWriter.print Char() 方法 Java.io.PrintWriter.print Boolean() 方法 package com.codingdict; import java.io.*; public class PrintWriterDemo { public static void main(String[] args) { boolean bool = false; try { // create a new writer PrintWriter pw = new PrintWriter(System.out); // print a boolean pw.print(true); // change the line pw.println(); // print another boolean pw.print(bool); // flush the writer pw.flush(); } catch (Exception ex) { ex.printStackTrace(); } } } Java.io.PrintWriter.format String() 方法 Java.io.PrintWriter.print Char() 方法