1.

How many catch blocks can a single try block can have?(a) Only 1(b) Only 2(c) Maximum 127(d) As many as requiredI have been asked this question in exam.Enquiry is from Exception Handling topic in division Exception Handling & Static Class Members of Object Oriented Programming

Answer»

Correct answer is (d) As MANY as required

Explanation: There is no LIMIT on the number of catch blocks corresponding to a try block. This is because the error can be of any type and for each type, a new catch block can be DEFINED. This is to make sure all type of EXCEPTIONS can be handled.



Discussion

No Comment Found

Related InterviewSolutions