I presume you are familiar with the Java Tutorial about Exceptions? Look for the link about "controversy" on the left.
I presume you realise that the number of different opinions about Java Exceptions obtained is exactly equal to the number of people asked?
The official answer is to avoid unchecked exceptions. Bruce Eckel (Thinking in Java 4th edition) suggests catching checked exceptions and wrapping them in RuntimeExceptions, which is different from what he said in the 3rd edition.
The ultimate root of this question is "Except if the exception is an exceptional exception" -> which I told my industrial engineer and I could read his face that what is going on here is lack of experience, discipline and skill. I think our advice to the beginner coder is that the definition of what constitutes an exception is a designe matter for the coder to determine.
If coder throws an un-checked exception, then coder has made the determination that the main method should throw. Generally not a good design practice but it is the coder that has to answer that question, not the designers of the language.
Originally posted by Stan James:
I think this is true - somebody let me know if not - Checked exceptions were a new concept in Java. Earlier languages had gotten along on fine with only unchecked exceptions. The Java crew must have been trying to solve some problem they had run across in other languages. Whether the problem needed solving and how well they did is all up for debate.
They were new-ish when Java was designed, but not a Java invention; C++ had exception specifications already, for example. In that language, it isn't the type of the thing you throw that determines checked-ness, but whether or not you declare it. If you declare that a method throws X, then X is effectively checked. After some experimentation, I think most folks simply didn't use the specifications, as they caused too much pain. Don't know what the current state of the art is, as I've been away from C++ for some years now.
Simple suggestion which will work in at least 0.0000000000000001% of all conceivable instances: