Kizspy | Question: 47 (Choose 1 answer)
How does the try-catch-finally statement work?
A. The code inside the try block is executed, and if an exception occurs, it is caught and handled by the catch block. The code inside the finally block is executed regardless of whether an exception occurred or not.
B. The code inside the try block is executed, and if an exception occurs, it is caught and handled by the finally block. The code inside the catch block is executed regardless of whether an exception occurred or not.
C. The code inside the try block is executed, and if an exception occurs, it is caught and handled by the catch block. The code inside the finally block is executed only if an exception occurred.
D. The code inside the try block is executed, and if an exception occurs, it is caught and handled by the catch block. The code inside the finally block is executed only if an exception occurred and was not caught by the catch block.