Tuesday, November 25, 2014

A program that prints the address of www.oreilly.com

import java.net.*;

class oreilly {

  public static void main (String args[]) {

    try {
      InetAddress address = InetAddress.getByName("www.oreilly.com");
      System.out.println(address);
    }
    catch (UnknownHostException e) {
      System.out.println("Could not find www.oreilly.com");
    }

  }

}

No comments: