February 2014
Beginner
1248 pages
62h 25m
English
• An exception indicates a problem that occurs while a program executes. The name “exception” suggests that the problem occurs infrequently—if the “rule” is that a statement normally executes correctly, then the problem represents the “exception to the rule.”
• Exception handling (p. 256) enables you to create fault-tolerant programs.
• When a Java program executes, the JVM checks array indices to ensure that they’re greater than or equal to 0 and less than the array’s length. If a program uses an invalid index, Java generates an exception (p. 256) to indicate that an error occurred in the program at execution time.
• To handle an exception, place any code that might throw an ...
Read now
Unlock full access