Page 589 - Introduction to Programming with Java: A Problem Solving Approach
P. 589
0.0 Last A-Head 555
14
CHAPTER
Exception Handling
Objectives
• Understand what an exception is.
• Use try and catch blocks for numeric input validation.
• Understand how catch blocks catch an exception.
• Explain the difference between checked and unchecked exceptions.
• Look up exception details on Sun’s Java API Web site.
• Catch exceptions with the generic Exception class.
• Use the getMessage method.
• Catch exceptions with multiple catch blocks.
Apago PDF Enhancer
• Understand exception messages.
• Propagate exceptions back to the calling module with the help of a throws clause.
Outline
14.1 Introduction
14.2 OverviewofExceptionsandExceptionMessages
14.3 UsingtryandcatchBlockstoHandle“Dangerous”MethodCalls
14.4 LinePlotExample
14.5 try Block Details
14.6 TwoCategoriesofExceptions—CheckedandUnchecked
14.7 UncheckedExceptions
14.8 CheckedExceptions
14.9 TheExceptionClassandItsgetMessageMethod
14.10 MultiplecatchBlocks
14.11 UnderstandingExceptionMessages
14.12 Usingthrows <exception-type>toPostponethecatch
14.13 GUITrackandProblemSolving:LinePlotExampleRevisited(Optional)
555