O'Reilly logo

Java 2™ Programmer Exam Cram™ 2 (Exam CX-310-035) by Marcus Green, Bill Brogden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exceptions

In the best of all possible worlds, nothing would ever go wrong in a Java program. In reality, your program may have to deal with many unexpected problems, such as missing files, bad user input, dropped network connections, and (unfortunately) programming errors. Java provides an elegant approach to handling these problems with the exception mechanism. This mechanism uses exception and error objects to handle everything from an end-of-file condition to an out-of-memory error. It also provides a mechanism that strongly encourages other users of your code to include exception handling. This is in contrast with other languages, such as C, that leave it up to the programmers to implement their own version of exception handling.

The Hierarchy ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required