previous | start | next

Unchecked Exceptions

Unchecked exceptions on the other hand should not occur if the program has been written carefully. Examples include passing inappropriate values to methods, calling methods when the state of the instance forbids it, and accessing arrays with a subscript out of bounds.

Generally a class will provide ways of checking any preconditions for calling its methods and so a program can be written to ensure that unchecked exceptions will not occur.



previous | start | next