1.

Multiple catch blocks __________________(a) Are mandatory for each try block(b) Can be combined into a single catch block(c) Are not possible for a try block(d) Can never be associated with a single try blockI have been asked this question in unit test.My question is based upon Exception Handling in portion Exception Handling & Static Class Members of Object Oriented Programming

Answer»

Correct CHOICE is (b) Can be combined into a SINGLE catch block

Best explanation: The separate catch blocks for a single try block can be combined into a single catch block. All TYPE of errors can be then handled in s single block. The type STILL have to be specified for the errors that might be produced.



Discussion

No Comment Found

Related InterviewSolutions