Chapter 11: Input/Output and Exception Handling

Problem Statement

Write a program that will extract and print the first URL that appears on each line of our course homepage.

Helpful Starter Code

String address = "http://cs.montana.edu/courses/160";
URL url = new URL(address);
URLConnection connection = url.openConnection();
InputStream stream = connection.getInputStream();
Scanner in = new Scanner(stream);

Lecture Code

Valid XHTML 1.0!