A finally block executes after the try and catch blocks, regardless of whether an exception occurs. It's commonly used for cleanup activities like closing file streams or releasing resources. For example, closing a database connection in the finally block ensures it is closed even if an error occurs during operations.