15. Handle Errors in a Mod
In This Chapter
• Respond to exceptions in your Java programs
• Create methods that ignore an exception
• Use methods that cause exceptions
• Create your own exceptions
Errors—the bugs, blunders, and typos that prevent a program from running correctly—are a natural part of the software development process. “Natural” is probably the kindest word that has ever been used to describe them.
Some errors are flagged by the compiler and prevent you from creating a class. Others are noted by the interpreter in response to a problem that keeps it from running successfully. Java divided errors into two categories:
• Exceptions—Events that signal an unusual circumstance has taken place as a program runs
• Errors—Events that signal ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access