Java I/O: How to append to an already existing text file

前端 未结 3 1894
温柔的废话
温柔的废话 2020-12-21 10:17

Hi I am having no problem writing to or appending to a file, the only problem is that as soon as I quit the program and then run it again, it creates a new file overwriting

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-21 10:24

    There is a constructor for FileWriter which allows you to set appending with a boolean. javadoc

提交回复
热议问题