package com.soar.chario;
import java.io.FileWriter;
import java.io.IOException;
public class Demo2_FileWriter {
/*
* *FileWriter类的write()方法可以自动把字符转为字节写出
FileWriter fw = new FileWriter("aaa.txt");
fw.write("aaa");
fw.close();
*/
public static void main(String[] args) throws IOException {
FileWriter fw = new FileWriter("yyy.txt");
fw.write("大家好,我是Soar_Sir!");
fw.write(97);
fw.close();
}
}
Java_基础—字符流FileWriter
最新推荐文章于 2023-02-08 15:07:51 发布