title: What is the use of printStackTrace() method in Java?
body: <p>I am going through a socket program. In it, <code>printStackTrace</code> is called on the <code>IOException</code> object in the catch block.<br>
  What does <code>printStackTrace()</code> actually do?</p>
  
  <pre><code>catch(IOException ioe)
  {
      ioe.printStackTrace();
  }
  </code></pre>
  
  <p>I am unaware of its purpose. What is it used for? </p>