November 2025
Intermediate to advanced
736 pages
21h 29m
English
In a perfect world, users would never enter data in the wrong form, files they choose to open would always exist, and code would never have bugs. So far, I’ve mostly presented code as if we all lived in this kind of perfect world. It is now time to turn to the mechanisms the Java programming language has for dealing with the real world of bad data and buggy code.
Encountering errors is unpleasant. If a user loses all the work he or she did during a program session because of a programming mistake or some external circumstance, that user may forever turn away from your program. At the very least, you must:
Notify the user of an error;
Save all work; and
Allow users to gracefully exit the program. ...
Read now
Unlock full access