java.util Collection interface understand1
来源:互联网 发布:php开源项目管理系统 编辑:程序博客网 时间:2024/06/06 12:13
java 中的 Collection 接口是所有集合类所实现的主要借口,是一个高度抽象的借口,包含了集合的基本操作和属性。
该接口继承自Iterable.
有两大类: List 和Set。 以后再说。先看Collection 都有哪些操作和属性。
Collection接口的详解如下
Collection interfacepackage java.util;public interface Collection<E> extends Iterable<e>{// return the number of elements in this collection contains no elementsint size();// return true if this collection contains no elementsboolean isEmpty();//return true if this collection contains the specified elementsboolean contains(Object o);// return an Iterator over the elements in this collectionIterator<E> iterator();//return an array containing all of the elements in this collectionObject[] toArray();//<T> T[] toArray(T[] a);//add an elementsboolean add(E e);//remove an elementboolean remove(Object o);//Returns true if this collection contains all of the elements // in the specified collection.boolean containsAll(Collection<?> c);//adds all of the elements in the specified collection to this collectionboolean addAll(Collection<? extends E> c);//Removes all of this collection's elements that are also contained in the //specified collectionboolean removeAll(Collection<?> c);//Retains only the elements in this collection that are contained in the specified collectionboolean retainAll(Collection<?> c);//clear the collection remove all the elements from this collectionvoid clear();//Compares the specified object with this collection for equality.boolean equals(Object o);//returns the hash code value for this collection.//while the collection interface adds no stipulations to the general contract//for the Object.hashCode methos, programmers should take note that any class that override//the Object.equals method must also override the Object.hashCode method in //order to satisfy the general contract for the Object.hashCode method .//In particular, c1.equals(c2) implies that c1.hashCode == c2.hashCodeint hashCode();}
0 0
- java.util Collection interface understand1
- java.util.Collection翻译
- java.util.Collection学习
- java.util.Collection接口
- java util collection
- JAVA UTIL COLLECTION
- 2、java.util.Collection
- 12. java.util.Collection
- Attempt to invoke interface method 'java.lang.Object[] java.util.Collection.toArray()' on a null obj
- Invoke interface method 'java.lang.Object[]java.util.Collection.toArray()'on a null object reference
- util.Collection与java.util.Collections区别
- java.util解析Collection接口
- java.util.Collection学习笔记
- java.util.Collection<E>接口
- Java基础知识:java.util.Collection集合
- java.lang.Object[] java.util.Collection.toArray()
- Java Collections Framework(1) Collection Interface
- JAVA之util中Collection接口
- Android——Notification状态通知栏
- C语言及程序设计初步例程-35 问题求解方法——迭代
- 好记性不如烂笔头9-HttpServletRequest常用方法和样例
- ECharts官网 标准地图实现
- Struts中的<bean:message/>出现乱码
- java.util Collection interface understand1
- Eclipse快捷键
- 丹麦哥本哈根大学计算机系 硕士课程讲义--3D计算机视觉(多视图几何)
- Qt界面包含MFC的ActiveX控件,界面焦点获取问题
- Codeforces Round #288 (Div. 2) 合集
- Web.xml详解
- redhat 6 配置 yum 源的两种方法
- 使用jquery-qrcode生成二维码
- 通达OA 通达使用者网络沟通交流会第一期通知