What are techniques for error handling
What is graceful termination
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.
What about illegal value error handling
The programmer might ignore return value of function. This may result in illegal value and result in crash of program
What about exception handling
Exception handling is more elegant way from other error handling mechanism. The separate the program logic and error handling code.
What data type should be use for throw
Primitive data types should be avoided. Create new classes to represent exception encountered.