title: FileWriter() will only append, not overwrite
body: <p>I have a method that is supposed to overwrite the current file with new content, however the FileWriter() is only appending the new content, not overwriting the old content.  </p>
  
  <p>This is how my FileWriter is set up</p>
  
  <pre><code>File file = new File(test.txt);
  BufferedWriter out;
  out = new BufferedWriter(new FileWriter(file, false));
  </code></pre>
  
  <p>Here is the save method</p>
  
  <pre><code>//stuff is defined earlier and filled with the new content for the file
  ArrayList&lt;String&gt; stuff = new ArrayList&lt;&gt;();
  
  //The actual save() method
  Object[] lines = stuff.toArray();
  for (Object item : lines) {
      out.write(item.toString());
      out.newLine();
  }
  out.flush();
  </code></pre>
  
  <p>The problem happens when I run this method, instead of overwriting the file, it appends the new content to the file.</p>
  
  <p>What I want:</p>
  
  <pre><code>line 1
  line 2
  line 3 &lt;--------- This is added when the file is overwritten
  </code></pre>
  
  <p>What Happens:</p>
  
  <pre><code>line 1
  line 2
  line 1 --|
  line 2   |------ This was all re-appended to the original 1st 2 lines
  line 3 --|
  </code></pre>