June 2017
Beginner
1296 pages
69h 23m
English
An exception indicates a problem that occurs while a program executes. Exception handling helps you create fault-tolerant programs that can resolve (or handle) exceptions. In some cases, this allows a program to continue executing as if no problems were encountered. For example, the StudentPoll application still displays results (Fig. 7.8), even though one of the responses was out of range. More severe problems might prevent a program from continuing normal execution, instead requiring it to notify the user of the problem, then terminate. When the JVM or a method detects a problem, such as an invalid array index or an invalid method argument, it throws an exception—that is, an exception ...