
92
Chapter 7: Input/Output 9
Most of the program's processing is within the try statement. In line 9, if the file
Filel.txt does not physically exist, then the java.io.YileReader constructor will raise a
YileNotYound_Exception. This exception is handled by the catch statement in line 15. In
this case, the program prints a message, then terminates using the System.exit method
(lines 16-17).
7.3 FilelnputStream and FileOutputStream
The FileReader and FileWriter streams handle 16-bit Unicode characters, so would normally
be used when handling files containing textual data. The equivalent byte streams, ...