**一、lterable、Collection、List、Set、Queue的关系

1:List、Set、Queue—继承—>Conllextion—继承—>Iterable

**二、lterable、Collection借口的remove()方法的区别
**
1.Iterable-remove()无参; Collecrion-remove(object)有参;

2.性能方法:Collection的remove方法必须首先找出要被删的项,采用的是单链表结构,
效率低需要一个一个遍历才能找到该对象;Iterator的remove方法结合next()方法使用,
效率高;

3.容错方面:使用Iteraor遍历时,使用Collection的remove会报错;Iterator不会报错;

三、Set借口:HashSet、TreeSet、LinkedHashSet的区别

1.HashSet:速度快,无序;

2.TreeSet:有序;

3.LinkedHashSet:顺序;

四、Queue接口

如图所示:

《java集合汇》

五、Map接口

1.HashMap:查询速度快,无序;

2.TreeMap:有序;

3.LinkedHashMap:顺序,查询速度快;

六、HashMap和HashSet区别
《java集合汇》

七、List、Set、Map之间的区别

《java集合汇》
更详细的请看下图

《java集合汇》

相关文章:

  • 2021-04-03
  • 2021-12-26
  • 2021-06-19
  • 2021-08-10
猜你喜欢
  • 2021-08-17
  • 2021-07-20
  • 2021-04-15
  • 2021-11-23
  • 2021-05-24
相关资源
相似解决方案