In Java, Collection interface (java.util.Collection) and Map interface (java.util.Map) are the two main “root” interfaces of Java collection classes.

结构

  • Collection
    • List
      • ArrarList
      • LinkedList
      • Vector (旧,淘汰)
    • Set
      • HashSet
        • LinkedHashSet
      • TreeSet
    • Queue
  • Map
    • TreeMap
    • HashMap
      • LinkedHashMap
  • Util
    • Collections
    • Arrays

Collection

List

  • 有序
  • 可重复
  • 有 index

Set

  • 无序
  • 数据唯一不重复
  • 无索引

Iterable

Collection extends Iterable