title: Overhead associated with Exception vs Throwable in Java
body: <p>I know </p>
  
  <pre><code>throw new Exception();
  </code></pre>
  
  <p>has a pretty large overhead, since it creates a full stackTrace, etc.<br>
  Does</p>
  
  <pre><code>throw new Throwable();
  </code></pre>
  
  <p>present the same problem? Is this behaviour inherited, or does throwing a Throwable has a smaller (o no) overhead?</p>
  
  <p><strong>EDIT</strong><br>
  From an <strong>analyst</strong> point of view, a user inserting wrong password is an exception to the normal execution order of a program. So if I have:</p>
  
  <pre><code>public Session newSession() {  
    validate_user_and_password();   
  }
  </code></pre>
  
  <p>throwing a UserNotValidException would sound correct from an <strong>analysts</strong> point of view.<br>
  Returning <code>null</code> or <code>0</code> just sounds incorrect if your code has pretty good abstraction. I just wanted to know if I could actually implement this in code, or if I'd have to just leave it to theory.</p>
  
  <p>There's a good difference between programming-point-of-view exception and analyst-point-of-view exception.</p>
  
  <p>Note: I've given a really simple and silly example, this is not quite my case.<br>
  Note 2: I know returning <code>null</code> would be the ordinary thing, but I'm required to have properly abstracted and OO code, and, personally, I see no harm in this.</p>