Uses BufferedReader, InputStreamReader, and URL to download and display the contents of an HTML file.
credits to sun and their tutorials.
Code:
package htmldownloader;
import java.net.*;
import java.io.*;
/**
*
* @author Dave
*/
public class Main {
public static void main(String[] args) {
try {
URL aURL = new URL("http://www.yahoo.com");
BufferedReader in = new BufferedReader(new InputStreamReader(aURL.openStream()));
String line;
while((line = in.readLine()) != null)
System.out.println(line);
} catch(MalformedURLException exc) {
System.out.println("Error! Malformed URL!");
} catch(IOException exc) {
System.out.println("Java I/O Exception!");
}
}
}
credits to sun and their tutorials.

