Hsah: Hash converts an arbitrary length through some (function function algorithm) to a fixed value, by hashing out the value, by locating only to the map,key-value rationale.
/**
* Hashtable is based on the implementation of the map interface. This version of the implementation provides the implementation of all map operations and allows NULL values and NULL keys
* There is no difference between HashMap and Hashtable in addition to allowing null values (NULL) and not supporting synchronization
* HashMap is not guaranteed to be orderly, especially if the order does not change with time
* This implementation provides a constant-time get and put operation, assuming that the hash function distributes the elements evenly across the bucket.
*
* A HashMap instance has two parameters that affect performance: initial capacity (initialcapacity) and load factor (load factor)
*capacity is the number of Hashtable barrels, the initial capacity is just the capacity to create
* Loading factor is the measure of how full the hash table automatically grows
* When the number of key-value pairs in the hash table exceeds the product of the capacity and load factor, the Hashtable is hashed (rehashed) (that is, the internal data structure is rebuilt) twice times the previous capacity
*
* Usually, the default load factor 0.75 can be a good trade-off between time and space, to avoid the time cost of a hash, you can set a larger initial capacity
* Too many keywords hashcode () The same can also lead to performance degradation, HASHMAP implementation of the use of keyword comparison between the order to balance
*
* Pay special attention to HASHMAP implementations do not support synchronization. If more than one thread synchronizes access to a hashmap, and more than a thread modifies the HASHMAP structure, external synchronization is required; (structural modification means adding or removing key-value pairs, only modifying value values is not a structural modification operation)
* If there is no such object, the map needs to be wrapped by the Collections.synchronizedmap () method, and it is best done when the map is created to prevent unexpected asynchronous access
* Non-synchronous access map:<pre>
* MAPM = Collections.synchronizedmap (new HashMap (...)); </pre>
*
The iterator for all collection views returned by the *hashmap class is "Fail-fast": After the iterator is created, the map structure is modified, and other than using the iterator's own remove method, the other throws the Concurrentmodificationexception exception
* But this behavior also does not guarantee that synchronization is not wrong
*/