Professional Documents
Culture Documents
Collection
Collection
Collection
ArrayList:
it is an ordered collection (by index), but not
sorted.
Set Interface
A Set cares about uniquenessit
doesn't allow duplicates.
The three Set implementations are
described in the following
HashSet:
A HashSet is an unsorted, unordered
Set. It uses the hashcode of the
object being inserted
LinkedHashSet:
A LinkedHashSet is an ordered
version of HashSet that
maintains a doubly-linked List across
all elements
Map Interface
A Map cares about unique identifiers.
HashMap :
The Hash Map gives you an unsorted,
unordered Map.
HashMap allows one null key and
multiple null values in a collection.
Hashtable is the synchronized
counterpart to HashMap.
Tree Map is a sorted Map.
LinkedHashMap Like
counterpart, LinkedH
LinkedHashMap collection maintain
order (or, optionally, ac
Although it
will be somewhat slowe
HashMap for adding an
elements, you can
expect faster iteration w
LinkedHashMap.
TreeMap You can pro
by now that a TreeMa
Map.