集合

在這裏插入圖片描述

1.依照實現接口分類:

實現Map接口的有:EnumMap、IdentityHashMap、HashMap、LinkedHashMap、WeakHashMap、TreeMap

實現List接口的有:ArrayList、LinkedList

實現Set接口的有:HashSet、LinkedHashSet、TreeSet

實現Queue接口的有:PriorityQueue、LinkedList、ArrayQueue

2.依據底層實現的數據結構分類:

底層以數組的形式實現:EnumMap、ArrayList、ArrayQueue
底層以鏈表的形式實現:LinkedHashSet、LinkedList、LinkedHashMap
底層以hash table的形式實現:HashMap、HashSet、LinkedHashMap、LinkedHashSet、WeakHashMap、IdentityHashMap
底層以紅黑樹的形式實現:TreeMap、TreeSet
底層以二叉堆的形式實現:PriorityQueue

常見的集合
集合框架的父接口map接口和Collection接口:

1.Collection接口的子接口包括:Set接口和List接口
2.Map接口的實現類主要有:HashMap、TreeMap、Hashtable、3.ConcurrentHashMap以及Properties等
4.Set接口的實現類主要有:HashSet、TreeSet、LinkedHashSet等
5.List接口的實現類主要有:ArrayList、LinkedList、Stack以及Vector等

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章