ABSTRACT

Java concepts Exceptions, checked and unchecked exceptions, throwing and catching of exceptions, and user-defi ned exception classes

Programming skills Write robust programs by incorporating exception handling

INTRODUCTION One of the most important qualities a program must possess is that of correctness. Th at is, if the input values satisfy the preconditions, the program will produce the output consistent with the specifi cation. However, program correctness does not guarantee any behavior on the part of the program if one or more input values violate their respective preconditions. All of us know the importance of defensive driving. Anticipating the unexpected can defi nitely save us from many catastrophic accidents. Similarly, irrespective of whatever precautions we take, some unexpected event or data can lead to catastrophic failure of the entire soft ware. To avoid such an eventuality, you need to cultivate the habit of defensive programming.