|
|
Javas exception handling scheme In Java, methods throw and catch exceptions. Exceptions are defined as classes. Many of the Java built-in classes can throw exceptions. The programmer can add new exceptions if necessary. To throw an exception is to indicate that an exception has occurred. When an exception is thrown, it must usually be caught (but see below for more information). Exceptions are defined as classes. For example, the exception generated by opening a file that does not exist is represented as an object the class FileNotFoundException . If we want to indicate that an attempt has been made to open a non-existent file, then we throw a FileNotFoundException . The mechanism for doing this will be described later. Back to top 
RITSEC - Global Campus Copyright ?1999 RITSEC- Middlesex University. All rights reserved. webmaster@globalcampus.com.eg |
|