Exam-style question
Try this first
What is the main purpose of exception handling in a program?.
- A.To respond to errors that occur while the program is running
- B.To make every variable a constant
- C.To convert all programs into machine code
- D.To remove the need for testing
Model answer
What a good answer should say
- To respond to errors that occur while the program is running
Explanation
Why this works
Exception handling allows a program to deal with an exceptional condition during execution rather than allowing the program to fail without a planned response.
Common mistake
No common mistake is linked to this question yet.
