posted 13 years ago
The purpose of a finally block is to execute some code regardless of how you exit the try block. That is, you could finish executing the try block normally, return from the inside the block, or throw an exception from inside the block. The finally block is great for closing an I/O stream, socket, db connection, or something similar. You've chosen to put a return statement there though. The exception stops execution of the try block, but the finally block still executes and returns true. You cannot both return a value and throw an exception from a method, so the exception "disappears".