Как очистить текстовый файл на Java
File file = new File("/path/to/file.txt");
PrintWriter writer = new PrintWriter(file);
writer.print("");
writer.close();
Karamolegkos
File file = new File("/path/to/file.txt");
PrintWriter writer = new PrintWriter(file);
writer.print("");
writer.close();