Collectionis an interface whereasCollectionsis a class.public interface Collection<E> extends Iterable<E>public class Collections extends Object
Collectionis an interface in Java. Most of the classes in Java Collection Framework inherit from this interface.List,SetandQueueare 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,HashSetandPriorityQueueare some indirect implementations of Collection interface.
WhereasCollectionsis a class.Collectionsclass extendsObjectclass. BothCollectioninterface andCollectionsclass are injava.utilpackage.
- The
Collectioninterface provides methods which provide the standard functionality of data structure to it’s sub interfaces and implementation classes.Collectionsclass is a utility class which providesstaticmethods to operate on collections. For example,Collectionsclass provides methods to sort, find maximum element in a collection.
