Which statement is/are true about Exception handling? i. There can be try…
2022
Which statement is/are true about Exception handling? i. There can be try block without catch block but vice versa is not possible. ii. There is no limit on the number of catch block corresponding to a try block. iii. The object used in catch clause is of specific class of which the error has occurred otherwise runtime error will occur. iv. To execute a code with each and every run of program, the code is written in finally block.
- A.
i and ii, iv
- B.
Only iii
- C.
Only ii
- D.
i and iv
Attempted by 116 students.
Show answer & explanation
Correct answer: A
The correct option is Option 1: i and ii, iv.
Statement i is true because a try block can be followed by a finally block instead of catch. Statement ii is true as one try can have multiple catch blocks. Statement iv is true because finally always executes. Statement iii is false; you can use a general Exception class to catch errors.