Handling Exceptions and Debugging

Bart Baesens, Aimée Backiel, Seppe vanden Broucke · 2012

This chapter offers the tools and techniques needed to handle the errors that might begin to pop up as our programs start to become more complex. It is divided into three main sections: types of errors, testing options, and programming styles. Actual solutions are put into practice with a chance to try them out on our own. Errors are almost unavoidable when programming. Just as when we are writing an essay and sometimes make typos or misuse words, we will make occasional mistakes when programming in Java. These mistakes can be referred to as bugs, errors, or exceptions. These mistakes are classified into three main categories: syntax errors, runtime errors, and logical errors. In general, syntax errors are the easiest to find and correct while logical errors are the most difficult. The chapter introduces the reader to some common exceptions, and shows how to handle them in our own programs.

Read the paper · More papers on PaperTik