Chinna Eranna wrote:Finally block is meant for cleanup.. and there is a rare possiblity of getting an exception there..
Closing streams, database connections etc are usually done in a finally block, and the close() method of all these can throw a checked exception. It's not so rare as you think.
You are right that in most of those cases all you can do is log the exception.