Downloading a Web page in Java using java.net.URL

import java.net.*;
import java.io.*;

public class URLReader {
    public static void main(String[] args) throws Exception {
        URL mb = new URL("http://www.martinbroadhurst.com/");
        BufferedReader in = new BufferedReader(new InputStreamReader(mb.openStream()));

        String inputLine;
        while ((inputLine = in.readLine()) != null) {
            System.out.println(inputLine);
        }

        in.close();
    }
}

Reference: Class URL