Chapter 9. Exceptions and Exception Handlers
All programs can fail at times. The causes vary from programming mistakes, to user error, to hardware faults or operating system mistakes. As a developer, part of your job is to create programs that handle failure properly. After all, why should users pay for software that terminates at the first sign of failure, causing unsaved data to be lost? You can guard against failure by taking advantage of Java's exception-handling mechanism. That mechanism, if used properly, can help you write robust code. What are exceptions? This chapter answers that question and shows you how to handle them in your programs.
What Are Exceptions?
A user inserts a floppy diskette into a disk drive and launches a file copy program ...
Get Java™ 2 by Example, Second 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.