7. Error handling with exception

The basic philosophy of Java is that "baddy-formed code will not be run".


The ideal time to catch the error is at compile time.  But most of the problems must be handled at run-time.  (readFile)

In earlier languages, if you were thorough enough to check for an error every time, your code could turn into an unreadable nightmare.  (readFile.err)

The word "exception" is ment in the sense of "I take exception to that."

Reading, writting and debugging code becomes much clearer with exceptions.  It departs code to handle error from "normal" code.  (readFile.exception)


Next Page