How to append data to a file?

后端 未结 4 940
长情又很酷
长情又很酷 2020-11-30 14:43

I trying to write into the txt file.
But with out losing the data that is already stored in the file.

But my problem that when I put string in the txt file, the

4条回答
  •  伪装坚强ぢ
    2020-11-30 15:15

    Create a separate variable to emphasize that, appending to file.

    boolean append = true;
    pw = new PrintWriter(new FileWriter(new File("filepath.txt"), append));
    

提交回复
热议问题