TheFreeSite.com!

Monday, July 28, 2008

Chapter 9: Error handling with exceptions

The basic philosophy of Java is that badly-formed code will not be run. As much as
possible, the compiler catches problems, but sometimes the problems – either
programmer error or a natural error condition that occurs as part of the normal
execution of the program – can be detected and dealt with only at run-time. Java
has exception handling to deal with any problems that arise while the program is
running. This chapter examines how the keywords try, catch, throw, throws, and
finally work in Java; when you should throw exceptions and what to do when you
catch them. In addition, you’ll see Java’s standard exceptions, how to create your
32 Thinking in Java www.BruceEckel.com
own, what happens with exceptions in constructors, and how exception handlers
are located.

0 comments:

Tell Me Doubts In Java