The finally block is a block that will be executed whether or not the exception is thrown/handled. It is useful to release resources, close connections, or close files.

Get hands-on with 1400+ tech skills courses.