Error Handling
It is extremely rare for a class to be written perfectly the first time. In most, if not all, situations, things will go wrong. Any developer who does not plan for problems is courting danger.
Assuming that your code has the capability to detect and trap an error condition, you can handle the error in several ways: On page 223 of their book Java Primer Plus, Tyma, Torok, and Downing (9781571690623) state that there are three basic solutions to handling problems that are detected in a program: fix it, ignore the problem by squelching it, or exit the runtime in some graceful manner. On page 139 of their book Object-Oriented Design in Java (978-1571691347), Gilbert and McCarty expand on this theme by adding the choice of throwing ...
Get The Object-Oriented Thought Process, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.