title: why does my teacher define PrintWriter this way
body: <p>I'm taking an intro java course and my teacher uses PrintWriter like this:</p>
  
  <pre><code>String fileName = "chars.txt";
  PrintWriter outFile = new PrintWriter(new FileWriter(fileName));
  </code></pre>
  
  <p>From the examples i've seen online, it seems people use one or the other. What I want to know is why he assigns FileWriter to PrintWriter like that? Not really a big deal it just bugs me and i want to know what's going on.</p>
  
  <p>It's an online course and the teacher doesn't answer questions anymore.</p>