title: How to update an existing file in Java?
body: <p>I have a text file including name, card number, balance and PIN. When I want to create a new account, it overwrites the existing file, which I don't want. If I create 2 new accounts at the same time, by adding another account, it will be replaced by the very first one and if I run it by one of my methods, it will double the existing account which the operation has been done on. Can someone please explain to me what should I do? <a href="https://i.stack.imgur.com/vgOZK.png" rel="nofollow noreferrer">pic</a> <a href="https://i.stack.imgur.com/5OQwM.png" rel="nofollow noreferrer">pic</a></p>
  
  <p>I have commented the print writer-part from existing code and it was no use.</p>
  
  <p>The problem starts where I want this to be able to append a new line and update the existing data at the same time.(updating balance for example)</p>