Difference between Collection interface and Collections class

Collection is interface in java.util package.
Collections is a class in java.util package.

java.util.Collection interface is Base interface for List, Set and Map interfaces.

java.util.Collections class has static methods, which perform operations or manipulations on any Collection. Below table shows list of static methods in Collections class.

Hence the purpose of java.util.Collection interface and java.util.Collections class is different.

Method Name Method Description
1 static <T> boolean addAll(Collection<? super T> c, T… elements) adds all elements of a Collection to the collection, with which this method is invoked.
2 static <T> Queue<T> asLifoQueue(Deque<T> deque) This method returns a view of a Deque as a Last-in-first-out (Lifo) Queue.
3 static <T> int binarySearch(List<? extends Comparable<? super T>> list, T key) searches the specified list for the specified object using the binary search algorithm.
4 static <T> int binarySearch(List<? extends T> list, T key, Comparator<? super T> c) searches the specified list for the specified object using the binary search algorithm.
5 static <T> void copy(List<? super T> dest, List<? extends T> src) copies all of elements from src List into dest List.
6 static boolean disjoint(Collection<?> c1, Collection<?> c2) returns true if the two collections(sent as parameters) have no elements in common.
7 static <T> List<T> emptyList() returns the empty list (immutable).
8 static <K,V> Map>K,V> emptyMap() returns the empty map (immutable).
9 static <T> Set<T> emptySet() returns the empty set (immutable).
10 static <T> Enumeration<T> enumeration(Collection<T> c) returns an enumeration to traverse over the specified collection.
11 static <T> void fill(List<? super T> list, T obj) replaces all elements of the specified list with the specified element(which is sent as second parameter).
12 static int frequency(Collection<?> c, Object o) returns the number of elements in the specified collection equal to the specified object(which is sent as second parameter).
13 static int indexOfSubList(List<?> source, List<?> target) returns the starting position of the first occurrence of the specified target list within the specified source list, or -1 if there is no such occurrence.
14 static int lastIndexOfSubList(List<?> source, List<?> target) returns the starting position of the last occurrence of the specified target list within the specified source list, or -1 if there is no such occurrence.
15 static <T> ArrayList<T> list(Enumeration<T> e) returns an array list containing the elements returned by the specified enumeration in the order they are returned by the enumeration.
16 static <T extends Object & Comparable< super T> >T max(Collection< extends T> coll) returns maximum element of the given collection, according to the natural ordering of its elements.
17 static <T> T max(Collection< extends T> coll, Comparator< super T> comp) returns the maximum element of given collection, according to order induced by specified comparator, passed as object.
18 static <T extends Object & Comparable< super T>>T min(Collection< extends T> coll) returns the minimum element of given collection, according to default natural ordering of its elements.
19 static <T> T min(Collection< extends T> coll, Comparator< super T> comp) returns the minimum element of given collection, according to the order induced by specified comparator, passed as object.
20 static <T> List<T> nCopies(int n, T o) returns an immutable list consisting n copies of the specified object.
21 static Set newSetFromMap(Map<E,Boolean> map) returns a set from the specified map.
22 static <T> boolean replaceAll(List<T> list, T oldVal, T newVal) replaces all occurrences of one specified value in a list with another.
23 static void reverse(List<> list) reverses the order of the elements in the specified list.
24 static <T> Comparator<T> reverseOrder() returns a comparator that imposes the reverse of the natural ordering on a collection of objects that implement the Comparable interface.
25 static <T> Comparator<T> reverseOrder(Comparator<T> cmp) returns a comparator that imposes the reverse ordering of the specified comparator.
26 static void rotate(List<> list, int distance) rotates the elements of the specified list by the specified distance.
27 static void shuffle(List<> list) randomly shuffles the elements in the List using a default source of randomness.
28 static void shuffle(List<> list, Random rnd) randomly shuffles the elements in the List using the specified source of randomness.
29 static <T> Set<T> singleton(T o) returns an immutable set containing only the specified object.
30 static <T> List<T> singletonList(T o) returns an immutable list containing only the specified object.
31 static Map<K,V> singletonMap(K key, V value) returns an immutable map, mapping only the specified key to the specified value.
32 static <T extends Comparable< super T>> void sort(List<T> list) sorts the specified list into ascending order, according to the natural ordering of its elements.
33 static <T> void sort(List<T> list, Comparator< super T> c) sorts the specified list according to the order induced by specified comparator object.
34 static void swap(List<> list, int m, int n) swaps the elements at the specified positions in specified list.

35 static <T> Collection<T> synchronizedCollection(Collection<T> c) returns a synchronized (thread-safe) collection backed by the specified collection.
36 static <T> List<T> synchronizedList(List<T> list) returns a synchronized (thread-safe) list backed by the specified list.
37 static <K,V> Map<K,V> synchronizedMap(Map<K,V> m) returns a synchronized (thread-safe) map backed by the specified map.
38 static <T> Set<T> synchronizedSet(Set<T> s) returns a synchronized (thread-safe) set backed by the specified set.
39 static <K,V> SortedMap<K,V> synchronizedSortedMap(SortedMap m) returns a synchronized (thread-safe) sorted map backed by the specified sorted map.
40 static <T> SortedSet<T> synchronizedSortedSet(SortedSet<T> s) returns a synchronized (thread-safe) sorted set backed by the specified sorted set.
41 static <T> Collection<T> unmodifiableCollection(Collection< extends T> c) returns an unmodifiable view of specified collection.
42 static <T> List<T> unmodifiableList(List< extends T> list) returns an unmodifiable view of specified list.
43 static <K,V> Map<K,V> unmodifiableMap(Map< extends K,? extends V> m) returns an unmodifiable view of the specified map.
44 static <T> Set<T> unmodifiableSet(Set< extends T> s) returns an unmodifiable view of the specified set.
45 static <K,V> SortedMap<K,V> unmodifiableSortedMap(SortedMap returns an unmodifiable view of the specified sorted map.
46 static <T> SortedSet<T> unmodifiableSortedSet(SortedSet<T> s) returns an unmodifiable view of the specified sorted set.

Below are methods provided by java.util.Collection interface,

Method Declaration Method Description
1 public boolean add(Object element) inserts an element in this collection.
2 public boolean addAll(Collection c) adds all elements of specified collection to invoking collection. collection elements in the invoking collection.
3 public boolean remove(Object element) deletes a specified element from this collection.
4 public boolean removeAll(Collection c) deletes all elements of invoking collection.
5 public boolean retainAll(Collection c) deletes all elements of invoking collection except the elements in specified collection(as parameter).
6 public int size() returns total number of elements in the collection.
7 public void clear() removes the total no of element from the collection.
8 public boolean contains(Object element) is used to search an element.
9 public boolean containsAll(Collection c) is used to search the specified collection in this collection.
10 public Iterator iterator() returns an iterator, to traverse thru elements of Colelction.
11 public Object[] toArray() returns an array of all Collection elements
12 public boolean isEmpty() return true if Collection is empty
13 public boolean equals(Object element) matches two collection.
14 public int hashCode() returns the hashcode number for collection.

You may also like to read:
Difference between Comparator and Comparable
Difference between List and Set
What is a Map
What are synchronized Collection