1.

Why do we need to handle exceptions?(a) To prevent abnormal termination of program(b) To encourage exception prone program(c) To avoid syntax errors(d) To save memoryI got this question in my homework.I'd like to ask this question from Exception Handling in portion Exception Handling & Static Class Members of Object Oriented Programming

Answer» RIGHT answer is (a) To prevent abnormal TERMINATION of program

Explanation: The exceptions should be handled to prevent any abnormal termination of a program. The program should keep running even if it gets INTERRUPTED in between. The program should preferable show the ERROR occurred and then retry the PROCESS or just continue the program further.


Discussion

No Comment Found

Related InterviewSolutions