Main differences between Collection and Collections are as
follows:
1. Collection is an interface in Java. But Collections is a
class in Java.
2. Collection is a base interface. Collections is a utility class
in Java.
3. Collection defines methods that are used for data structures
that contain the objects. Collections defines the methods
that are used for operations like access, find etc. on a
Collection
xxxxxxxxxx
class GFG {
public static void main (String[] args)
{
// Creating an object of List<String>
List<String> arrlist = new ArrayList<String>();
// Adding elements to arrlist
arrlist.add("geeks");
arrlist.add("for");
arrlist.add("geeks");
// Printing the elements of arrlist
// before operations
System.out.println("Elements of arrlist before the operations:");
System.out.println(arrlist);
System.out.println("Elements of arrlist after the operations:");
// Adding all the specified elements
// to the specified collection
Collections.addAll(arrlist, "web", "site");
// Printing the arrlist after
// performing addAll() method
System.out.println(arrlist);
// Sorting all the elements of the
// specified collection according to
// default sorting order
Collections.sort(arrlist);
// Printing the arrlist after
// performing sort() method
System.out.println(arrlist);
}
}
https://www.geeksforgeeks.org/collection-vs-collections-in-java-with-example/