Adv Java Program : Write a java program to display IPAddress and name of client machine.
IP_Address.java
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());
}
}
run : javac IP_Address.java
java IP_Address
0 Comments