Take the 2-minute tour ×  Possible Duplicate: When to choose
checked and unchecked exceptions  When should I create a checked
exception, and when should I make a runtime exception?  For
example, suppose I created the following class:  public class
Account {     private float balance;      /* ... constructor,
getter, and other fields and methods */      public void
transferTo(Account other, float amount) {         if (amount >
balance)             throw new NotEnoughBalanceException();
/* ... */  How should I create my NotEnoughBalanceException?
Should it extend Exception or RuntimeException? Or should I just
use IllegalArgumentException instead?  share|improve this
question  marked as duplicate by finnw, user714965, Don Roby,
Mark, Matteo Nov 22 '12 at 15:29   Really looking forward to the
answers here. I've become sufficiently disenfranchised with
checked exceptions that I don't think answer from me would
actually be useful/helpful, but I'll be fascinated to see
answers from others :) –  Jon Skeet Ja