Author Topic: Write a program to get the Host Name on the basis of IP address  (Read 434 times)

0 Members and 1 Guest are viewing this topic.

Offline ebenzunlimited

  • Lead Admin
  • *****
import java.net.*;
public class HostName
{
public static void main(String args[])
{

InetAddress inetAddress =InetAddress.getByName("127.64.84.2");//get the host Inet using ip
System.out.println ("Host Name: "+ inetAddress.getHostName());//display the host

}

}
Insane I Lived♥ Sane I Died♥<img src='http://i253.photobucket.com/albums/hh74/reallytired2/family%20pictures/buckeye%20stuff/clap.gif' />

 

* Newest Techies

Inside: 3P Techies Blog

Get Updates


Sign up to get latest updates delivered to your inbox. No Spam, We Promise!


Copyright 3rd Planet Techies. All rights Reserved.

Top || Mobile || Privacy