Home / Questions / Which block is always executed no matter which exception is thrown?
Explanatory Question

Which block is always executed no matter which exception is thrown?

👁 28 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

The finally block is always executed, whether or not an exception occurs.
It is used for cleanup operations like closing files or releasing resources.