O'Reilly logo

Beginning Java Programming by Seppe vanden Broucke, Aimee Backiel, Bart Baesens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6Handling Exceptions and Debugging

WHAT YOU WILL LEARN IN THIS CHAPTER:                

  • What kinds of errors can occur in programming
  • How to find errors in your program
  • How to handle exceptions that could crash your program
  • How to test your program

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

The wrox.com code downloads for this chapter are found at www.wrox.com/go/beginningjavaprogramming on the Download Code tab. The code is in the Chapter 6 download and individually named according to the names throughout the chapter.

You are now midway through this book. You’ve learned the basics of Java and programming already. In the following chapters, you’ll be going more in depth with object-oriented programming and interacting with users and data sources outside your Java program. This chapter is placed in between to offer you the tools and techniques needed to handle many of the errors that might begin to pop up as your programs start to become more complex. The chapter is divided into three main sections: types of errors, testing options, and programming styles. You saw the concepts introduced as early as Chapter 1, but here you will see actual solutions put into practice with a chance to try them out on your own. By the end of this chapter, you should have developed the skills to avoid errors while you program and to find and fix the errors that will still inevitably occur.

RECOGNIZING ERROR TYPES

Errors are almost unavoidable when programming. Just as when you are writing an essay ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required