title: Is there a way to throw an exception without adding the throws declaration?
body: <p>I have the following situation.</p>
  <p>I have a Java Class that inherits from another base class and overrides a method.
  The base method does not throw exceptions and thus has no <code>throws ...</code> declaration.</p>
  <p>Now my own method should be able to throw exception but I have the choices to either</p>
  <ul>
  <li>Swallow the exception or</li>
  <li>Add a throws declaration</li>
  </ul>
  <p>Both a not satisfying because the first one would silently ignore the exception (ok I could perform some logging) and the second would generate compiler errors because of the different method headers.</p>
  <pre><code>public class ChildClass extends BaseClass {
  
          @Override 
          public void SomeMethod() {
              throw new Exception(&quot;Something went wrong&quot;);
          }
  }
  </code></pre>