title: RuntimeException and ArithmeticException Java
body: <p>I have the following class:</p>
  
  <pre><code>public class TryCatchExample {
      public static void main(String[] args) {
          try {
              System.out.println(1/0);
          }catch (RuntimeException e) {
              System.out.println("Runtime exception");
          } catch (ArithmeticException e) {
              System.out.println("Trying to divide by 0 is not ok.");
          } 
          finally {
              System.out.println("The program will now exit");
          }
      }
  }
  </code></pre>
  
  <p>The compiler throws this error: </p>
  
  <pre><code>TryCatchExample.java:10: error: exception ArithmeticException has already been caught
          } catch (ArithmeticException e) {
            ^
  1 error
  </code></pre>
  
  <p>Why does this occur? ArithmeticException is a subset of RuntimeException, so would this be throwing a RuntimeException or an ArithmeticException?</p>
  
  <p>Thanks!</p>