I am putting together a list outlining the characteristics of the
Java Collection implementation classes. I am using a bullet point format to quickly identify the features. Please contribute, keeping the points concise.
-------Collection Class Implementation Features----------
HashSet
�Not ordered
�Allows null
�No Duplicates. Classes must implement equals() and hashCode() for this to work properly.
�Not
thread safe
TreeSet
�Ordered ascending by natural order. Classes must implement the Comparable interface
�Can pass Comparator to customize ordering
�No nulls
�Not Thread safe
LinkedHashSet
�Insertion order
�Not thread safe
HashMap
�Null values and keys okay
�Not ordered�
Not thread safe
TreeMap
�Keys ordered ascending by natural order. Classes must implement the Comparable interface.
�Can pass Comparator to customize key ordering
�Not Thread safe
LinkedHashMap
�Not thread safe
ArrayList
�Not Thread safe
LinkedList
�Insertion order
�Used for queues and stacks
�Not thread safe
Vector
�Thread Safe
HashTable
�Thread Safe
�No null keys or values�No Duplicates. Key classes must implement equals() and hashCode() for this to work properly.
--------Collection Interfaces---------
Set
List
Map