title: why does the toString method shows error?
body: <p>This is my code. I have overridden the <code>toString()</code> method. So, when an object <code>e</code> is being printed the overridden method must be called. But I don't see the method being called. </p>
  
  <pre><code>public static void main(String[] args) {
  
          try
          {
              String name="foo";
              int a =Integer.parseInt(name);
          }catch (NumberFormatException e)
          {
              System.out.println(e);
          }
  
      }
      public String toString()
      {
          return "err";
      }
  
  }
  </code></pre>