1.

If classes produce some exceptions, then ______________________(a) Their respective catch block must be defined(b) Their respective catch blocks are not mandatory(c) Their catch blocks should be defined inside main function(d) Their catch blocks must be defined at the end of program

Answer» Correct choice is (a) Their respective catch block must be defined

The explanation: The catch blocks must be defined. This is to ensure that all the exceptions related to the classes are handled by the program code and the program doesn’t terminate unexpectedly.


Discussion

No Comment Found

Related InterviewSolutions