InetAddress hashCode() Example

Returns a hashcode for this IP address.


InetAddressclass hashCode() method example. This example shows you how to use hashCode() method.This method Returns a hashcode for this IP address.

Here is the code:-
/* 
 * @Program that  Returns a hashcode for this IP address.
 * GetHostName.java 
 * Author:-RoseIndia Team
 * Date:-19-Jun-2008
 */

import java.net.*;
public class Hashcode {
public static void main(String[] argsthrows UnknownHostException{
InetAddress ia = InetAddress.getLocalHost();
//Returns a hashcode for this IP address.
int s=ia.hashCode();
System.out.println("Hashcode for this IP address is: "+s);

    }
}

Output of the program:-
 Hashcode for this IP address is: 2130706689

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US