Try-Catch-Finally

State the function of the “Try-Catch-Finally” block

E

Expert

Verified

Try ” block includes those statements which may results in the exception and the Catch block handles this exception, if any occurs. “Catch ” block comprises of the statements which have to be executed, whenever an exception occurs. The “Finally ” block gets always executed, irrespective of the fact whether an exception occurs or not. The finally block is generally used to perform the clean-up process. In case any exception occurs within the try block, the control of the program is directly transferred to its corresponding catch block and then to the finally block. If no exception occurs within the try block, then control of the program is directly transferred to the finally block.

   Related Questions in DOT NET Programming

©TutorsGlobe All rights reserved 2022-2023.