You should read what hashmap is . In general, a hash is a data structure for efficient storage of arbitrary data (values ) in the table.
A common problem with storing information in any structure is how to quickly search for data again once it is in the structure. The hash solves this problem using keys . The value key determines where in the table the value will be stored using some hash function . They are used in the hash in the same way as the index used in the array:
array[index] => some_value hash{key} => some_value
In the case of "put (Object key, Object value)", the "value" object is the data that you want to save, and the "key" object is what you will use to output data from the hash:
MyObject myKey = new MyObject( ... ); MyOtherObject myValue = new MyOtherObject( ... ); ... myHash.put( myKey, myValue );
source share