title: Difference between PrintWriter and FileWriter class
body: <pre><code>try{
  
      File file = new File("write.txt");
      FileWriter writer = new FileWriter(file);
  
      PrintWriter printWriter = new PrintWriter(writer);
      printWriter.println("pqr");
      printWriter.println("jkl");
      printWriter.close();
  
      PrintWriter printWriter = new PrintWriter(file);
      printWriter.println("abc");
      printWriter.println("xyz");
      printWriter.close();
  }
  </code></pre>
  
  <p>I don't understand what is difference bet'n these two way.
  In which scenario i should use printWriter and fileWriter.</p>