0 votes
in JAVA by
What is the purpose of the “finally” block in a try-catch-finally statement in Java?

a) To catch and handle exceptions

b) To specify the code that should be executed after the try or catch block

c) To specify the code that should be executed before the try or catch block

d) None of the above

1 Answer

0 votes
by

Answer: b) To specify the code that should be executed after the try or catch block

Explanation: The “finally” block is used to specify the code that should be executed after the try or catch block, regardless of whether an exception was thrown or not.

Related questions

0 votes
asked May 3, 2021 in JAVA by Robindeniel
0 votes
asked Jun 20, 2023 in HDFS by Robin
...