title: How to read from a PrintWriter when used with string
body: <p>The code says:</p>
  
  <pre><code>PrintWriter write = new PrintWriter("newFile.txt");
  write.println("TransformersLegends");
  </code></pre>
  
  <p>What is the best way to read from the file? I can't use <code>File</code> or <code>Buffered Reader</code> as it takes a <code>file</code> object and here I'm trying with a <code>string</code>.</p>