lycos.java Source code

Java tutorial

Introduction

Here is the source code for lycos.java

Source

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

public class lycos {

    public static void main(String[] args) {

        try {
            String thisLine;
            URL u = new URL("http://www.google.com");
            DataInputStream theHTML = new DataInputStream(u.openStream());
            while ((thisLine = theHTML.readLine()) != null) {
                System.out.println(thisLine);
            } // while loop ends here
        } catch (MalformedURLException e) {
            System.err.println(e);
        } catch (IOException e) {
            System.err.println(e);
        }

    }

}