equals() | Returns true if this IP address is the same as that of the object specified. Equals() method don't consider hostnames while comparing and only consider IP address associated. |
getAddress() | Returns the raw IP address of this InetAddress object as an array. The order in which bytes appear in an array is the same as in IP address i.e. getAddress[0] will contain the highest order byte. |
getByAddress() | Create an InetAddress object. It takes the hostname and IP address as its parameter. The hostname can be the machine name as in "www.geeksforgeeks.org" or its textual IP address. |
getByName() | Returns the IP Address of the host specified. If the host is a literal IP address, then only its validity is checked. |
getAllByName() | Returns an array of IP addresses for the given host |
getLoopbackAddress() | Returns the loopback address |
getHostAddress() | Returns IP address in textual form. |
getHostName() | Returns the hostname for this IP Address. If this object was created with a hostname then it is returned, otherwise, a reverse lookup is performed to return the system configured hostname. |
getLocalHost() | Returns the IP address of the local host. |
getCanonicalHostName() | Returns the fully qualified domain name for this object. If this object was created with a hostname then it is returned, otherwise, a reverse lookup is performed to return the system configured hostname. |
hashCode() | Returns the hashcode associated with this address object. |
isAnyLocalAddress() | Returns true if this address represents a local address. |
isLinkLocalAddress() | Returns true if this address is a link-local address. |
isLoopbackAddress() | Returns true if this address is a loopback address. |
isMCGlobal() | Returns true if this multicast address has global scope. |
isMCLinkLocal() | Returns true if this multicast address has link scope. |
isMCNodeLocal() | Returns true if this multicast address has node scope. |
isMCOrgLocal() | Returns true if this multicast address has organization scope. |
isMCSiteLocal() | Returns true if this multicast address has site scope. |
isMulticastAddress() | Returns true if this address is an IP multicast address. Multicast addresses have 1110 as their first 4 bits. |
isReachable() | Returns true if this address is reachable. ICMP echo requests are used if permission can be granted otherwise the host tries to make a TCP connection at port 7 of the destination. This method is used generally as a pre-condition in various programs, to avoid Host Unreachable exceptions in the future |
isReachable() | Specify the network interface to be used while checking for reachability and the ttl parameter specifies the number of hops the echo packet makes before exiting the network. |
isSiteLocalAddress() | Returns true if this address is a site-local address. |
toString() | Converts the IP address to the string. It returns the result as hostname / IP address. |