Write a java program to find an IP address of the machine on which the
program runs?
Program
import java.net.InetAddress;
public class IP_Address
{
public static void main(String args[]) throws Exception
{
InetAddress IP = InetAddress.getLocalHost();
System.out.println("IP of my system is := "+IP.getHostAddress());
}
}
Output
IP of my system is := 127.0.1.1