import java.net.*;
import java.io.*;

/**
 * Based on a program in Gittleman, Advanced Java, pp. 67-68
 */
public class TryURL {

    /**
     * Reads a page from the Web and displays it.
     * 
     * @param args Ignored.
     */
    public static void main(String[] args) {
        BufferedReader input;
        String line;
        try {
            URL url = new URL("http://www.cis.upenn.edu/~matuszek/cit597-2004");
            input = new BufferedReader(new InputStreamReader(url.openStream()));
            line = input.readLine();
            while (line != null) {
                System.out.println(line);
                line = input.readLine();
            }
            input.close();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}

