In Java exception handling, which block is generally used to clean up at the end of
Executing a try block?
a) catch
b) finally
c) throw
d) new
Answers
Answered by
0
Explanation:
B Finally block is the answer
Answered by
0
Option (B)
Java exception handling is generally used to clean up at the end of Executing a try block finally.
finally:
- Finally, the try keyword is used in conjunction with a block called finally.
- It defines that is always run after the try and catch blocks and before the method is completed.
- The final block executes regardless of whether an exception is thrown or caught.
- Because it executes regardless of whether or not an exception occurs, the final block is frequently used to perform cleanup such as terminating connections, closing files, or freeing up threads.
Similar questions