1.

What is the difference between error and exception?(a) Both are the same(b) Errors can be handled at the run-time but the exceptions cannot(c) Exceptions can be handled at the run-time but the errors cannot(d) Both can be handled during run-timeI have been asked this question in an interview for internship.I would like to ask this question from Exception Handling in chapter Derived Classes, Templates & Exception Handling in C++ of C++

Answer»

The CORRECT choice is (C) Exceptions can be handled at the run-time but the ERRORS cannot

The best I can explain: Exceptions can be handled during run-time whereas errors cannot be because exceptions occur DUE to some unexpected CONDITIONS during run-time whereas about errors compiler is sure and tells about them during compile-time.



Discussion

No Comment Found

Related InterviewSolutions