|
|

|  |
Why exceptions get ignored ? We have already seen that the programmer should not ignore exceptions. Why would they get ignored? There are two main reasons: The programmer does not anticipate that a particular method can go wrong The programmer delays writing instructions to handle the exception, then forgets to do it later
File handling in particular is an area where a great many things can go wrong. It can be very time-consuming (and sometimes difficult) to write instructions that deal correctly with all the possible exceptions. Javas exception handling scheme is designed to make it difficult for the programmer to forget or ignore exception handling. Whenever an exception can occur, the programmer is forced to do something about it, even if it is only to write instructions to ignore it. It is important to realize that good exception handling requires a lot of extra programming. In many cases, there may be as much or more code concerned with exception handling than with the normal operation of the program. Back to top 
RITSEC - Global Campus Copyright ?1999 RITSEC- Middlesex University. All rights reserved. webmaster@globalcampus.com.eg |
|