Chapter 11: Exceptions


Overview

At several points in this book, you have seen how certain program features alter the usual linear flow of program execution. You saw that loops are like whirlpools, conditional statements are like forks in the road, and method calls are like detours.

Extending this analogy, exceptions are like jumping through hyperspace. With exceptions, you can instantly end up far from where you began, with no prospect of getting back. Of course, jumping through hyperspace is an unusual way to travel. And as you might expect, exceptions are to be used only in unusual programming circumstances.

This chapter will show you how to use exceptions to indicate unusual conditions in the state of your programs. It will take a careful approach to this topic, because exceptions are complicated. It would not be helpful to overwhelm you with information. First you'll look at some of the basic concepts of exceptions. Then you'll learn how exceptions are used in real life.




Ground-Up Java
Ground-Up Java
ISBN: 0782141900
EAN: 2147483647
Year: 2005
Pages: 157
Authors: Philip Heller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net