![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
集合
胡亚洲
中北大学毕业生
展开
-
List.add(index,element)方法
List.add(index,element)方法 index必须在集合已有元素的size之内,如果集合为空(size为0),调用该方法报错。 index有效的话会替换原有元素的位置(原有元素index会靠后一个下标-->index + 1); /** * Inserts the specified element at the specified position in this * list. Shifts the element currently at that position (if.原创 2020-09-03 17:03:14 · 3781 阅读 · 0 评论 -
list set map归纳总结
Arraylist 和 Linkedlist 都是按顺序存储,可以重复。单列集合 HashSet 存放基本数据类型自动排序,不能存放重复数据,存放引用数据类型是按hashcode方法和equals方法存放(无序,按hashcode方法); LinkedHashSet 存放基本数据类型和引用数据类型时按顺序排序,不能存放重复数据。(是否重复用hashcode方法和equals方法) TreeSe...原创 2019-07-19 15:08:22 · 113 阅读 · 0 评论