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);
}
} |
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);
}
}
Editorial Team
We are a group of young techies trying to provide the best study material for all Electronic and Computer science students. We are publishing Microcontroller projects, Basic Electronics, Digital Electronics, Computer projects and also c/c++, java programs.
how to compile this progrem in terminals???
how to compile this dns program in terminal???