Discussion
Exception handling is not meant to handle problems for which case ?
(i) termination of program
(ii) handle return value representing error
(iii) hand return a legal value and leave the program in an illegal state
(iv) call an error handler function
Answer: C
The key is (iv) only, and the source behind it could not be traced.
The four items are the usual ways a program can deal with a run-time error without exceptions: terminate, return an error value, return a legal value and leave the program in an illegal state, or call an error-handler function. Exception handling is introduced as a replacement for those approaches, and the question asks which case it is not meant for. The key picks the call to an error handler function.
The wording is unclear. A search found a similar list of alternatives to exceptions in a C++ textbook but nothing that names (iv) as the one exception handling is not meant for, so the answer rests on the key. Options A, B and D each include (i), (ii) or (iii), which the key treats as cases exceptions do cover.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development