import java.net.*;
import java.io.*;
public class ip_localmachine
{
public static void main(String args[]) throws Exception
{
InetAddress ipadd =InetAddress.getLocalHost();
System.out.println("Host and Address :"+ipadd);
System.out.println("Host name :"+ipadd.getHostName());
String n=ipadd.toString();
System.out.println("IP address :"+n.substring(n.indexOf("/")+1));
}
}
Java program To display Local machines IP Address
Related Post
Subscribe to:
Post Comments (Atom)
0 Comments