Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed CS to throw a new exception

...

Code Block
bgColor#ccccff

import java.io.FileInputStream;
import java.io.FileNotFoundException;

class NewException extends Exception {
//common exception for abstraction purposes	
}

class ExceptionExample {
  public static void main(String[] args) throws NewException {
    try {
      FileInputStream dis = new FileInputStream("c:\\" + args[0]);
    }
    catch(FileNotFoundException fnf) { 
      System.out.println("Error: Operation could not be performed"throw new NewException(); 
    } //sanitized message
  }
}

...