title: Do I need to create a new PrintWriter instance to see each write to file?
body: <p>I have a long running process where I want to continually write to a file and see the output as I go. Basically logging. (I cannot use any logging frameworks) Unless I call <code>close()</code> on <code>PrintWriter</code>, I do not see anything new in the file.</p>
  
  <p>Must I create a new instance of <code>PrintWriter</code> each time I want to see the output in the file? I may have hundreds of writes. </p>
  
  <pre><code>FileWriter fw = new FileWriter(new File("F.txt"), true);            
  PrintWriter pw = new PrintWriter(fw, true);
  pw.println("Line 1");
  pw.println("Line 2");
  pw.flush();
  pw.close();
  </code></pre>