1. java.util.Collection is a collection interface . It provides a general interface method for basic operations on collection objects. The Collection interface has many specific implementations in the Java class library. The meaning of the Collection interface is to provide a unified operation method for various specific collections.
Collection ├List │✜LinkedList │✜ArrayList │└Vector │└Stack └Set2. java.util.Collections is a wrapper class. It contains various static polymorphic methods for collection operations. This class cannot be instantiated , just like a tool class , serving Java's Collection framework.
import java.util.ArrayList; import java.util.Collections; import java.util.List; public class TestCollections { public static void main(String args[]) { //Note List is a List that implements the Collection interface. List = new ArrayList(); double array[] = { 112, 111, 23, 456, 231 }; for (int i = 0; i < array.length; i++) { list.add(new Double(array[i])); } Collections.sort(list); for (int i = 0; i < array.length; i++) { System.out.println(list.get(i)); } // Result: 23 111 112 231 456 } }The above article briefly talks about the difference between Collection and Collections in Java is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.