Java file writing FAQ: How do I append text to the end of a text file in Java?
The short answer is that you should create a
FileWriter instance with the append flag set to true, like this:
BufferedWriter bw = new BufferedWriter(new FileWriter("checkbook.dat", true));
The rest of this article explains this.