Reference: http://blog.csdn.net/xiaodifa995455120/article/details/7277441
http://www.apkbus.com/forum.php?mod=viewthread&tid=52426
Hashmap is the most commonly used map, which stores data according to the hashcode value of the key, which can be obtained directly from the key, with fast access speed.
HashMap allows a maximum of one record's key to be null, allowing multiple records to have a value of NULL; HashMap does not support thread synchronization, where multiple threads can write HashMap at any one time, and may result in inconsistent data. If synchronization is required, you can use the collections Synchronizedmap method to make the HashMap capable of synchronizing. Statement block or method HashMap with synchronized adornment operation
Such as:
Map systemusers = Collections.synchronizedmap (New HashMap ());
HashTable It does not allow a record key or value to be null; it supports thread synchronization and is slow.
TreeMap is able to sort its saved records by key, by default in ascending order, or by specifying a sort comparer, when traversing treemap with iterator, the resulting record is unordered, and it does not allow the record key or value to be empty. Use: http://my.oschina.net/liyuanjinglyj/blog/126539 key value to implement comparable after the addition of automatic sorting, iterater read in order.
Linkedhashmap Linkedhashmap, the key and the value can be null, you can make the order of insertions, in the iterator traversal Linkedhashmap, the first obtained records must be inserted first. It is slower than hashmap when traversing.
HashTable HashMap TreeMap Linkedhashmap Difference