Tuesday, November 25, 2014

A program that prints the address of 72.167.232.155

import java.net.*;

class MyHostName{

  public static void main (String args[]) {

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

  }

}

No comments: