Java集合大致可以分爲Set、List、Queue、Map四種體系,其中set代表無序、不可重複的集合;List代表有序、重複的集合;Map代表具有映射關係的集合;Java5增加的Queue體系代表一種隊列集合實現。
Java的集合類主要由兩個接口派生而出:Collection和Map,Collection和Map是Java集合框架的根接口,這兩個接口又包含了一些子接口和實現類。
Collection集合體系 |
Collection(接口)
|----Set(接口)
|----EnumSet
|----SortedSet(接口)
----TreeSet
|----HashSet
----LinkedHashSet
|----Queue(接口)
|----Deque(接口)
----ArrayDeque
----LinkedList
|----PriorityQueue
|----List(接口)
|----LinkedList
|----ArrayList
|----Vector
----Stack
Map集合體系 |
Map(接口)
|----HashMap
----LinkedHashMap
|----HashTable
----Properties
|----SortedMap
----TreeMap
|----EnumMap
|----IdentityHashMap
|----WeakHashMap