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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What data type should be use for throw

A

Primitive data types should be avoided. Create new classes to represent exception encountered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly