Professional Documents
Culture Documents
Lecture08 CH 15-I (Exceptions)
Lecture08 CH 15-I (Exceptions)
Exceptions
Reading Reference: Chapter 16
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved.
Exceptions
Exceptions
• The syntax
Exceptions – Flow of Control
Exceptions
• Exceptions - Terminology & keywords
– Exception: Object/value that signal an exception
– Throw an exception: throw the exception
– Catch an exception: catch{} after try{}
• Exceptions – Flow of Control
• Exception Example: Divide by Zero
• Exception Not Caught?
– Program terminate
Catching all exceptions
- general Catch
• Three dots …
indicate variable
no of args
Object Oriented Approach to
Exception Handling
Creating classes for exceptions