Whether the parentheses are thread safe
List:linkedlist (NO) ArrayList (NO) Vector (yes) Stack (yes)
Map:hashmap (NO) linkedhashmap (NO) HashTable (yes) Weakhashmap TreeMap
Set:hashset (NO) linkedhashset (NO) SortedSet TreeSet
Most commonly used as if the first two of each row
Characteristics:
1. Linked opening for quick insertion, deleting elements, linked maintaining the order in which elements are inserted
2. Set is implemented on a HashMap basis, so the key at the end of the set is not duplicated
3. The tree begins with a sequence of changes occurring at a slower speed
Apply:
1. Need to quickly insert, delete elements, with LinkedList; Requires fast random access to elements, with ArrayList
2. Vectors are similar to ArrayList, but are synchronous
3. Stack inherits vectors, is the last-in-first-out stacks
4. HashMap, the position of the put in the object will change, Linkedhashmap will not
5. HashSet is specifically designed for quick queries, insert will produce a sort (linkedhashset not), the object deposited HashSet must define Hashcode method
6. SortedSet is a set interface that maintains an ordered sequence of elements, and the elements added to the SortedSet implementation class must implement the comparable interface, and the TreeSet class is its only implementation
Other:
1. unsynchronized can be externally synchronized, or use Collections.synchronizedmap () method to wrap it into a thread-safe map/set
2. Linkedhashmap supports two kinds of sorting: Insert order, Access order. The former refers to the order in which they are inserted, which refers to the order in which the oldest use is used to the most recent
List Map Set Summary