title: Why is throws part of the method signature
body: <p>Why <code>throws</code>, on a method, is part of its signature? It seems strange to include it. Here is an example where it is in the way:</p>
  <pre class="lang-java prettyprint-override"><code>@Overide
  public void foo() {
      throw new UnsupportedOperationException();
  }
  </code></pre>
  <p>If anyone were to see this method from the outside, they might try to use it without knowing that it is not supported. They would only learn it on trying to run the code.</p>
  <p>However, if they could do something like this they would know by looking at the method that it is not supported and if <code>UnsupportedOperationException</code> was not extending <code>RuntimeException</code>, they would get a compilation error. EDIT1: But this is not possible because <code>throws</code> is part of the signature so override will not work.</p>
  <pre class="lang-java prettyprint-override"><code>@Overide
  public void foo() throws UnsupportedOperationException {
      throw new UnsupportedOperationException();
  }
  </code></pre>
  <p>This question concerns Java's design, so I know that it might be hard to answer without one of the people that work on it drops by and answers it, but I was hoping that maybe this question has been asked to them before or that there might be an obvious reason to have it this way to explain why.</p>