正在加载图片...
编程红宝书(珍藏版) ava 完金自学手册 6.2.1 Collection接口定义与应用 Collection代表一组对象,这些对象称为它的元素。 Collection 是容器继承树中的顶层接口,作为接口它定义了15个方法,但没 有提供具体实现。 Collection接口如下所示: 1 public interface Collection<E> extends Iterable<E>t 2口的基本操作 nt size 4 boolean is Emptyo 5 boolean contains(Object element); 6 boolean add(E elements) 7 boolean remove(object element) 8 Iterator<E> iterator 9 boolean equals(object element 11∥12到16行为Buk操作 12 boolean containsAll(Collections?> c); 13 boolean addAll( Collection<? extend E>c); 14 boolean removeAll( Collection<?> c);" 15 boolean retainAll( Collection<?> c); 16 void clear 17∥以下为数组操作 18 Objectl toArrayO 19T≥ TI toArray(Ta); Q想桃工业出隙6.2.1 Collection接口定义与应用 • Collection代表一组对象,这些对象称为它的元素。Collection 是容器继承树中的顶层接口,作为接口它定义了15个方法,但没 有提供具体实现。Collection接口如下所示:
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有