打印流(PrintWriter)

打印流(PrintWriter)

package com.tiedandan.IO流.打印流;

import java.io.FileNotFoundException;
import java.io.PrintWriter;

public class PrintWriterClass {
    public static void main(String[] args) throws Exception {
        PrintWriter pw = new PrintWriter("d:\\print2.txt");
        pw.println(97);//PrintWrite类可以忽略掉字符转换.97本应转换为对应的字母a,但是打印的却是数字97
        pw.println('a');
        pw.println(true);

        pw.close();
        System.out.println("执行完毕");
    }

 

posted on 2021-11-24 12:51  张铁蛋666  阅读(36)  评论(0编辑  收藏  举报

导航