title: Throwing general exception in Java
body: <p>This is for an online tutorial in throwing exceptions</p>
  
  <p>I am trying to do something like this:</p>
  
  <pre><code>int power(int n, int p){
          try
          {
              return (int)Math.pow(n,p);
          }
          catch(Exception e)
          {
              throw new Exception("n and p should be non-negative");
          }
      }
  </code></pre>
  
  <p>But I get the error </p>
  
  <blockquote>
    <p>error: unreported exception Exception; must be caught or declared to be thrown</p>
  </blockquote>