This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
IllegalThreadStateException is only thrown because of programming errors - the programmer forgot to put the call in a synchronized block / method for the object that wait, notify etc is called on. InterruptedException is, like IOException and SQLException, caused by a situation the programmer can do little about. They cannot be prevented by adding checks etc.
The general convention is:
- unchecked exceptions can be prevented by adding checks. NullPointerException, IllegalArgumentException, NoSuchElementException, in 99.99% of the cases these can be prevented (e.g. by checking against null etc).
- checked exceptions are caused by an external influence. This could be the hard disk, network, but also user interaction in the case of interrupting.
There are of course cases where exceptions don't follow this convention (CloneNotSupportedException is one of these...) but you'll see that most exceptions follow this convention.