Java InetAddress getHostName() methodThe getHostName() method Java InetAddress returns the host name of a corresponding IP address. If this InetAddress was created with a host name, this host name will be remembered and returned else a reverse name lookup will be performed and the result will be returned based on the system configured name lookup service. Syntax:ReturnsIt returns the host name for this IP address, or if the operation is not allowed by the security check, the textual representation of the IP address Example 1Test it NowOutput: DESKTOP-6FMEL47
Next TopicInetAddress Class
|