title: Writing to console with System.out and PrintWriter
body: <p>While reading about Java I/O, i realized that there are two ways through which i can write to the standard output. </p>
  
  <p>Following is the snippet that uses both the techniques</p>
  
  <pre><code>import java.io.*;
  public class ConsoleIO {
  
      public static void main(String[] args) {
          System.out.println("Method 1");
  
          PrintWriter writer = new PrintWriter(System.out);
          writer.println("Method 2");
          writer.flush();
          writer.close();
      }
  }
  </code></pre>
  
  <p>Are there any performance benefits of using one over the other?</p>