Interface and Class Details

Interface Collection

public abstract interface Collection
						

The Collection interface is the base interface for all Collection interfaces and the basis of all Collection classes in the Collection framework. Collection is simply a set of objects that can be treated as individual items or as a group. The Collection interface specifies methods for dealing with individual objects, such as add(), and for dealing with a whole Collection at once, such as removeAll().

Methods
boolean     add(Object o)
boolean     addAll(Collection c)
void        clear()
boolean     contains(Object o)
boolean     containsAll(Collection c)
boolean     equals(Object o)
int         hashCode()
boolean     isEmpty()
Iterator    iterator()
boolean     remove(Object o)
boolean     removeAll(Collection ...

Get PURE Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.