•Java’s object oriented mechanism for error handling
•more powerful, more flexible than using return
•Java keywords try, catch, throw,throws
•in class: banking
system, Juno with Exceptions
•for hw: improve
Exception handling in Juno 7.5
•Model
–in client: instead of testing a
returned value
•try,
hoping for the best
•prepare to pick up the pieces if necessary (catch)
–in code where the error may
occur:
•detect error
•create a new Exception and throw it