9.1 Exceptions
9.1 Exceptions
Exception
try block
finally
•As in the diagram, the “finally”
block is guaranteed to run
whether or not an exception
occurs.
•A “finally” block is used to ensure
that all the clean up work is done
after an exception occurs
•Closing a file
•Closing a result set(used in database
programming)
•Closing connection established with
the database.