title: JAVA. I am getting an 'unreported exception' compiler error
body: <p>I am trying to compile this code, but it keeps having an error,</p>
  
  <pre><code>errThrower.java:37: error: unreported exception Exception; must be caught or declared to be thrown
  throw new Exception();  
  </code></pre>
  
  <p>This exception is thrown in the <code>callmethodErr()</code>, and I thought it has been caught in main, but I can't figure out what is happening. </p>
  
  <p>Thanks all.   </p>
  
  <pre><code>import java.util.IllegalFormatConversionException;
  
  public class errThrower 
  {
    public static void main(String[] args)
    {
      try
      {
        callmethodErr();
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
    }
  
    public static void methodErr() throws Exception
    {
      System.out.println("error thrown from methodErr");  
    }
  
    public static void callmethodErr()
    {
      try
      {
        methodErr();
      }
      catch (Exception e)
      {
        System.out.println("error thrown from callMethodErr");
        throw new Exception();      
      }
    } 
  }
  </code></pre>