title: PrintWriter overwrite data
body: <p>I'm trying to keep track of a high score in a game I'm making by doing:</p>
  
  <pre><code>PrintWriter out = new PrintWriter(new File("path"));
  while(gameLoop) {
      out.write(highScore);
      out.flush();
  }
  </code></pre>
  
  <p>It keeps appending the data to the end of the file. I am aware I could <code>out.close();</code> and then <code>out = new PrintWriter(new File("path"));</code> but that seems like a lot of excess code. Constantly closing and re-opening the file to achieve overwrite. Is there any way for my <code>PrintWriter</code> to overwrite the data without closing and re-opening the file?</p>