Java集合的继承关系

图来自https://blog.csdn.net/biexiaofei/article/details/77031003

常问的:

  1. LinkedList继承自AbstractSequentiaList抽象类,并不是继承的AbstractList
  2. ArrayList继承自AbstractList抽象类
  3. Stack继承自Vector
  4. HashSet与TreeSet继承自AbstractSet,另外TreeSet实现了Sorted接口
  5. 而Sorted接口继承set接口
  6. HashMap继承了AbstractMap抽象类,而它的子类有LinkedHashMap(添加了保证顺序的功能)
  7. HashMap、WeakHashMap、HashTable、TreeMap、IdentityHashMap都继承了AbstractMap抽象类,而TreeMap又实现了SortedMap接口

相关文章: