NetworkInterface hashCode Example

NetworkInterface class hashCode example. This example shows you how to use hashCode method.


NetworkInterface class hashCode example. public int hashCode() Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

Here is the code
/*
 * @ # HashCode.java
 * A class repersenting use to HashCode method 
 * of URL class in java.net package
 * version 23 June 2008
 * author Rose India 
 */

import java.net.*;

public class HashCode {

    public static void main(String args[]) throws Exception {
        byte b[] {127001};
        InetAddress inetAddress = InetAddress.getByAddress(b);
        NetworkInterface networkInterface =
                NetworkInterface.getByInetAddress(inetAddress);
        System.out.println("Hash code : " + inetAddress.hashCode());
    }
}

Output
Hash code : 2130706433

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

HOME | COPYRIGHT | CONTACT US