//JAVA Program to Get IP Address of Computer System
package Diploma;
import java.net.InetAddress;
public class IPA
{
public static void main(String args[]) throws Exception
{
InetAddress addr = InetAddress.getLocalHost();
System.out.println("Local IP Host Address: "+addr.getHostAddress());
String hostname = addr.getHostName();
System.out.println("Local Host name: "+hostname);
}
}
No comments:
Post a Comment