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
Answer and explanation
Concise answer
To respond to errors that occur while the program is running
Why this is correct
Exception handling allows a program to deal with an exceptional condition during execution rather than allowing the program to fail without a planned response.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
