CBSE Class 12 Computer Science
Question 4 of 30
Exception Handling — Question 4
Back to all questions 4
Question Assertion (A): No matter what exception occurs, you can always make sure that some common action takes place for all types of exceptions.
Reasoning (R): The finally block contains the code that must execute.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Both A and R are true and R is the correct explanation of A.
Explanation
The 'finally' block contains code that must execute, irrespective of whether an exception is raised. This ensures that some common action takes place for all types of exceptions, no matter which exception occurs.