Number of questions 1,751
Number of tests completed 247,601
Number of questions answered 3,708,424
Number of registered users 19,012
Sign In | Register
Skip Navigation Links
Question: Is finally block executed if there is no exception?
Answer1: No
Answer2: Yes
Answer3: Sometimes
Answer4: None
Answer: Yes

Explaination: The finally block is always executed, regardless of whether an error was thrown. If code in the try block doesn't throw an error (that is, if the try block completes normally), then the code in the finally block is still executed. The finally block is executed even if the try block exits using a return statement.

Correctly answered: 26583
Incorrectly answered: 5479
Terms of Use Ver. 2.0.6783.38332