Figure 4


(a) Creating a URL object; (b) reading in product information.

(a)
URL store_url = new URL("http://www.iconcomp.com/store.dat");
URL base = new URL("http://www.iconcomp.com");
URL store_url = new  URL( base, "store.dat");

(b)
URLConnection u = store_url.openConnection();
DataInputStream superStore = new DataInputStream(u.getInputStream());