Example usage for java.util Hashtable hashCode

List of usage examples for java.util Hashtable hashCode

Introduction

In this page you can find the example usage for java.util Hashtable hashCode.

Prototype

public synchronized int hashCode() 

Source Link

Document

Returns the hash code value for this Map as per the definition in the Map interface.

Usage

From source file:Main.java

public static void main(String args[]) {
    // create hash table 
    Hashtable<Integer, String> htable1 = new Hashtable<Integer, String>();

    // put values in table
    htable1.put(1, "A");
    htable1.put(2, "B");
    htable1.put(3, "C");
    htable1.put(4, "from java2s.com");

    // get the hash code value
    System.out.println("Hash code value is :" + htable1.hashCode());
}