Java Files for In-Class Use
Examples of Reading Data from Files and WWW Pages
The following two examples use the newer THROW and CATCH mechanism for reading files. In the first I demonstrate how to use this for reading a text file in a manner similar to what I did above. In the second I use the exact same code, but instead of using the FileReader class I switch to the URL class to read from the Web.