Exceptions
Exceptions
 

Recall from our discussions of exceptions Tuesday morning ...

UNCHECKED EXCEPTIONS.

The compiler does NOT check for these possible exceptions. You can compile code that may be logically buggy.

CHECKED EXCEPTIONS are different. Your source code is examined by the compiler for their very possibility -- checked by the compiler

The compiler won't let your code compile unless in the source code you either

  • declare such exceptions to be thrown or
  • use a try/catch on these exceptional conditions

java.io.FileNotFoundException is a CHECKED exception.

Complete these linked excercises scanning from multiple files

( RECALL notes on FileIOClient_2A&FileIOClient_2B. )

WHEN YOU FINISH THEM, you should have 2 files named:

    FileIOClient_2a.java
    FileIOClient_2b.java