📜  如何在java代码示例中清除文本文件

📅  最后修改于: 2022-03-11 14:52:12.315000             🧑  作者: Mango

代码示例1
File file = new File("/path/to/file.txt");
PrintWriter writer = new PrintWriter(file);
writer.print("");
writer.close();