01. Example:
import java.net.InetAddress; class getIPAddress { public static void main(String args[]) throws Exception { System.out.println("You IP Address: " + InetAddress.getLocalHost()); } }
Output:
You IP Address: 50ebdf8d6ef6/172.17.0.8
import java.net.InetAddress; class getIPAddress { public static void main(String args[]) throws Exception { System.out.println("You IP Address: " + InetAddress.getLocalHost()); } }
Output:
You IP Address: 50ebdf8d6ef6/172.17.0.8