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 assumptions about a program are not correct.