![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
集合
Michael_ZY_0
这个作者很懒,什么都没留下…
展开
-
集合类Collection
Java集合可分为Collection和Map两个体系。 Collection接口分为Set和List,Set:元素无序不可重复的集合, List:元素有序,可重复的集合。Map接口:映射关系的“key-value”键值对的集合。Map接口继承类: <—HashTable<—–Properties<—HashMap<—–LinkedHashMap<—SortedMap<—–TreeMa原创 2016-07-06 00:37:53 · 402 阅读 · 0 评论 -
集合List接口
List接口的实现常用类:JDK API中List接口的实现类常用的有:ArrayList、LinkedList和Vector。List接口根据索引提供的常用方法:void add(int index, Object ele) boolean addAll(int index, Collection eles) Object get(int index) int indexOf(Object原创 2016-07-09 10:42:29 · 318 阅读 · 0 评论 -
Set接口
set接口定义:Set接口是Collection的子接口,set接口没有提供额外的方法Set 集合不允许包含相同的元素,如果试把两个相同的元素加入同一个 Set 集合中,则添加操作失败。Set 判断两个对象是否相同不是使用 == 运算符,而是根据 equals 方法set接口的实现类:HashSetHashSet 按 Hash 算法来存储集合中的元素,因此具有很好的存取和查找性能。HashS原创 2016-07-09 10:54:11 · 333 阅读 · 0 评论