Summary
Now that you have put Java's exception-handling techniques to use, I hope the subject of errors is a little more popular than it was at the beginning of the hour.
You can do a lot with these techniques:
Catch an exception and deal with it
Ignore an exception, leaving it for another class or the Java interpreter to take care of
Catch several different exceptions in the same try-catch block
Throw your own exception
Managing exceptions in your Java programs makes them more reliable, more versatile, and easier to use, because you don't display any cryptic error messages to people who are running your software.
Once you're comfortable handling errors, you can even use assertions to create more of them—as a safeguard against the times when your ...
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