其他分享
首页 > 其他分享> > 打印流(PrintWriter)

打印流(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("执行完毕");
    }

 

标签:PrintWriter,pw,打印,io,println,97
来源: https://www.cnblogs.com/zhangtiedangg/p/15597592.html