Chapter 43 Flashcards
1
Q
What are techniques for error handling
A
- Abnormal termination
- Graceful termination
- Return the illegal value
- Return error code
- Exception handling
2
Q
What is graceful termination
A
Program can be designed in such a way that instead of abnormal termination, that causes a wastage of memory, resources, program perform clean up tasks.
3
Q
What about illegal value error handling
A
The programmer might ignore return value of function. This may result in illegal value and result in crash of program
4
Q
What about exception handling
A
Exception handling is more elegant way from other error handling mechanism. The separate the program logic and error handling code.
5
Q
What data type should be use for throw
A
Primitive data types should be avoided. Create new classes to represent exception encountered.