title: Try Catch Exceptions of the Same Type Java
body: <p>I want to know if there is a way to have the same exception type in a catch. </p>
  
  <p>So basically we have this:</p>
  
  <pre><code>catch(IllegalArgumentException exception){
    throw new IllegalArgumentException("Error CheckingAccount: negative initial balance");
    throw new IllegalArgumentException("Error deposit: negative amount");
    throw new IllegalArgumentException("Error withdraw: illegal amount");
  }
  </code></pre>
  
  <p>I was wondering how it can change between the same exception type but have it be called when it is needed. Do I need <code>if-else</code> statements? By the way this is not in main. </p>
  
  <p>To be specific this is <code>String getMessage()</code>.</p>