I have to admit to feeling exceptions are used rather to much in Java, that sometimes what is an Exception actual should be an Error cos there is no way to recover from it. But I do not agree with C# method of no checked exceptions.

Check out the Java Tutorial on Exceptions, heres a discussion of Unchecked Exceptions, from the Exception tutorial.

Originally posted by Gavin Tranter: Are you really sure you wnat to throw an unchecked exception?

Would an Error be better?

Throwing Errors is very rarely a good idea, and certainly not something for beginners to do.

The idea of the distinction between RuntimeException and Error is that the former is evidence of a bug in a specific piece of code, whereas an Error is evidence of a JVM-wide problem. Examples: -

NullPointerException typically means that a particular thread has encountered a bug in a particular piece of code. But it might well be possible, and sometimes appropriate, for other threads to carry on running other pieces of code.

But OutOfMemoryError means that the whole JVM has run out of memory, and is in a state where data may be inconsistent. There is no way that any useful work can be done, once this has happened, and the only valid action is to try to close down the application as gracefully as possible.

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.