package com.test1;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
public class Test6 {
public static void main(String[] args) {
try {
// 创建打印流对象
PrintWriter pWriter = new PrintWriter("b.txt");
// 写入数据
pWriter.write("凉凉");
pWriter.write("嘿嘿");
pWriter.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
打印流实现向文件中写入数据
最新推荐文章于 2023-07-13 17:20:22 发布