CISC370-011 -- demo code from class #10

This page provides links to some short snippets of code from class #10 (Nov 11).

U0.java is a simple demonstration of the InetAddress class.

U1.java uses the openStream() method of the URL class to fetch the contents of one or more URLs supplied on the command line.

U2.java parses a number of different types of URLs.

U3.java demonstrates conversion between absolute and relative URLs.

U4.java uses a URLConnection to fetch data from a remote resource.

U5.java shows a more-sophisticated use of the URLConnection class to retrieve HTTP data using the POST method.

SockFetch.java uses a raw Socket connection to fetch a Web page.

C1.java illustrates some elementary list operations.

C2.java shows a TreeSet ordered with a custom Comparator.

C3.java demonstrates subrange Collections of a TreeSet.

C4.java is a simple example of a HashMap.