Collection
is an interface whereasCollections
is a class.public interface Collection<E> extends Iterable<E>
public class Collections extends Object
Collection
is an interface in Java. Most of the classes in Java Collection Framework inherit from this interface.List
,Set
andQueue
are main sub interfaces of this interface. JDK doesn’t provide direct implementations of this interface. But, JDK provides direct implementations of it’s sub interfaces.ArrayList
,HashSet
andPriorityQueue
are some indirect implementations of Collection interface.
WhereasCollections
is a class.Collections
class extendsObject
class. BothCollection
interface andCollections
class are injava.util
package.
- The
Collection
interface provides methods which provide the standard functionality of data structure to it’s sub interfaces and implementation classes.Collections
class is a utility class which providesstatic
methods to operate on collections. For example,Collections
class provides methods to sort, find maximum element in a collection.