Java Program to find the IP Address
The below listed simple Java program can print the IP Address ( Internet Protocol Address) of your Computer.
// Java Code to display IP Address on screen
import java.net.InetAddress;
class IPAddress
{
public static void main(String args[]) throws Exception
{
System.out.println(InetAddress.getLocalHost());
}
}
/192.168.1.103
The below listed simple Java program can print the IP Address ( Internet Protocol Address) of your Computer.
Program:
// Java Code to display IP Address on screen
import java.net.InetAddress;
class IPAddress
{
public static void main(String args[]) throws Exception
{
System.out.println(InetAddress.getLocalHost());
}
}
Output:
/192.168.1.103