PrintWriter 类输出到文件
public static void main(String[] args) throws IOException {
String path = "d:\\test.txt";
FileWriter fw = new FileWriter(path, true); // true 表示在文件上续写
PrintWriter pw = new PrintWriter(fw);
String str = new String("hello");
原创
2020-10-26 10:10:19 ·
860 阅读 ·
0 评论