2077 7

CSC419 ยท 2077 ยท 5 marks

When does the finally block is mandatory in while handling exception? Describe with a suitable scenario.

When does the finally block is mandatory in while handling exception? Describe with a suitable scenario. [5]

Advanced Java ProgrammingChapter 1: Programming in JavaHandling Exceptions

The finally block in Java is a block that always executes regardless of whether an exception occurs or not. It is used to place important cleanup code such as closing connections, releasing resources, or closing files. --- The finally block becomes mandatory (strongly required / best practice) in...