title: PrintWriter not printing out complete string
body: <p>I have the following code</p>
  
  <pre><code>FileWriter F = new FileWriter("out.txt");
  PrintWriter H = new PrintWriter(F);
  H.print(split[split.length - 2]);
  H.print("END");
  </code></pre>
  
  <p>When I examine the txt however, the last text is NOT 'END', but part of a word in the string. It is "repa"</p>
  
  <p>When I do this</p>
  
  <pre><code>FileWriter F = new FileWriter("out.txt");
  PrintWriter H = new PrintWriter(F);
  System.out.print(split[split.length - 2]);
  </code></pre>
  
  <p>The last bit of text I get is the number '49' - this is correct. </p>
  
  <p>It appears that the PrintWriter is not fully writing out the string. However, when I do this</p>
  
  <pre><code>FileWriter F = new FileWriter("out.txt");
  PrintWriter H = new PrintWriter(F);
  H.print(split[split.length - 2]);
  H.println(pdfInText)://Another string
  H.print("END");
  </code></pre>
  
  <p>The 'original' text now actually finishes - what is this?</p>