title: Write to a file without overwriting the existing data within that file
body: <p>I have a filewriter that takes String data from the user and writes it on the file. But the filewriter replaces the already existing data in that file. How do I prevent it from doing it? I just want to keep adding information without writing over something.</p>
  
  <p>Here is the code </p>
  
  <pre><code>    String info = scan.nextLine();
      File myFile = new File ("/home/greg/workspace/Mavericks/fred.txt");
      FileWriter writer = new FileWriter (myFile);
      writer.write(register);
      writer.flush();
  </code></pre>
  
  <p>Thanks. I fixed that. Now I just want to make the writer write using spaces. When I write to the file it just keeps writing within the same line. </p>