// This program prompts for a url and shows the content of the corresponding // web page import java.io.*; import java.util.*; import java.net.*; public class EchoWebPage { public static void main(String[] args) throws IOException { Scanner console = new Scanner(System.in); System.out.println("This programs shows the content of a web page."); System.out.print("url? "); String url = console.nextLine(); Scanner input = new Scanner(new URL(url).openStream()); while (input.hasNextLine()) { String line = input.nextLine(); System.out.println(line); } } }