常用数据结构——Collection

环境:JDK1.8

List:

有序可重复
- ArrayList
1、底层是数组;
2、默认容量为10;
3、最大容量为(Integer.MAX_VALUE-8);
4、扩容时新容量为旧容量的1.5倍,即新容量=旧容量*1.5;
5、非线程安全。

  • Set:无序不可重复,只能存在一个null
    • HashSet
      1、底层是HashMap;
      2、具体API可参照HashMap。

猜你喜欢

转载自blog.csdn.net/chineseyoung/article/details/80870894