title: Full path of an exception in java
body: <p>I am trying to throw a custom exception</p>
  
  <pre><code>class NumberFormatException extends Exception
  {
    public NumberFormatException() {}
  
    //Constructor that accepts a message
    public NumberFormatException(String message)
    {
      super(message);
  
    }
  }
  </code></pre>
  
  <p>Later, I am throwing this exception using</p>
  
  <pre><code> throw new NumberFormatException("Exception found");
  </code></pre>
  
  <p>and later on catching it using</p>
  
  <pre><code>catch(NumberFormatException e)
  {
      System.out.println(e);
  }
  </code></pre>
  
  <p>It prints something like </p>
  
  <pre><code>NumberFormatException: Exception found
  </code></pre>
  
  <p>Is it possible to print something like:</p>
  
  <pre><code>java.lang.NumberFormatException: Exception found
  </code></pre>
  
  <p>The constraint is the <code>catch</code> code can't be modified i.e</p>
  
  <pre><code>catch(NumberFormatException e)
     {
       System.out.println(e);
     }
  </code></pre>