Pergunta de entrevista da empresa LBi Software

What is the use of finally keyword in Java?

Resposta da entrevista

Sigiloso

12 de abr. de 2019

After performing a try-catch block finally is executed to free resources associated with the exception. Example, a BufferedReader may throw an exception but before instanting we must open a File for which we must close() regardless if BufferedReader raises an exception or not hence we use a finally block.