import java.net.UnknownHostException;
public class ToDetectIPAdress {
public static void main(String[] args) {
try {
System.out.println(InetAddress.getLocalHost().getHostName());
System.out.println(InetAddress.getLocalHost().getHostAddress());
} catch (UnknownHostException e) {
e.printStackTrace();
}
}
--*--
No comments:
Post a Comment