O'Reilly logo

Oracle Certified Associate, Java SE 7 Programmer Study Guide by Richard M. Reese

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

Chapter 8. Handling Exceptions in an Application

Exceptions are objects that are thrown by an application or the Java Virtual Machine (JVM) when an error of some sort occurs. Java provides a wide range of predefined exceptions and allows the developer to declare and create their own exception classes.

While there are a number of ways of classifying exceptions, one scheme classifies them into three types:

  • Program errors
  • Improper use of code
  • Resource-related failures

Program errors are internal flaws in a code sequence. The programmer may or may not be able to do much about these types of errors. For example, a common exception is NullPointerException . This is frequently a result of not properly initializing or assigning a value to a reference variable. ...

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