7.3 Standard Java exceptions



Throwable is a class describes anything that can be thrown as an exception.  There are two types of  Throwable.
  1. Error
  2. Exception

7.3.1 The special case of RuntimeException

If a RuntimeException gets all the way out to main() without being caught, printStackTrace() is called for that exception as the program exits.

Case Study: NeverCaught.java

RuntimeException represents a programming error:

  1. An error you cant catch.
  2. An error that you, as a programmer, should have checked for in your code.

Next Page