Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java IOException

try {
    FileInputStream fileHanlde = new FileInputStream(fileName);    // this file doesn't exist
} catch (FileNotFoundException e) {
    System.out.println("Sorry can't find the file");    // always catch the most specific exception first
} catch (IOException e) {
    System.out.println("Unknown IO error");
} finally {
    System.out.println("Clean up duty");
}
 
PREVIOUS NEXT
Tagged: #java #IOException
ADD COMMENT
Topic
Name
6+4 =