Java program to display the IP Address of a particular Host

Friday, April 30th, 2010

Program : To display the IP Address of a particular Host
By : Kapil Lohia

import java.net.*;
import java.io.*;
 
public class ip_host
{
	public static void main(String args[]) throws Exception
	{
		System.out.println("Enter the host name :");
		String n=new DataInputStream(System.in).readLine();
 
		InetAddress ipadd =InetAddress.getByName(n);
 
		System.out.println("IP address :"+ipadd);
	}
}
Avatar of Ranjith

Author Name :
Ranjith

Total : 0 Comment


Leave a Reply

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup

Email: