打印流
-
PrintWriter
-
封装了Print() / Println()方法 支持写入后换行。
-
支持数据原样打印。
-
案例
/* * PrintWrite * */ public class TestPrintWrite { public static void main(String[] args) throws Exception { //创建 PrintWriter pw = new PrintWriter("F:\\IO\\321.txt"); //打印 pw.println(97); pw.println(true); pw.println(3.12); pw.println('c'); pw.close(); //关闭 System.out.println("执行完毕"); } }
-