February 2014
Beginner
1248 pages
62h 25m
English
All exception types that are direct or indirect subclasses of RuntimeException (package java.lang) are unchecked exceptions. These are typically caused by defects in your program’s code. Examples of unchecked exceptions include:
• ArrayIndexOutOfBoundsExceptions (discussed in Chapter 7)—You can avoid these by ensuring that your array indices are always greater than or equal to 0 and less than the array’s length.
• ArithmeticExceptions (shown in Fig. 11.3)—You can avoid the ArithmeticException that occurs when you divide by zero by checking the denominator to determine whether it’s 0 before performing the calculation.
Classes that inherit directly or indirectly from class Error (Fig. 11.4) are unchecked ...
Read now
Unlock full access