The Collection collection interface, which refers to the Java.util.Collection interface, is the superclass interface of the set, List, and Queue interfaces.
List:
Lists are the list of things that concern the index.
The list can have duplicate elements.
The list can have null values.
List is used to store the same type of data, only one store, cannot store key value pairs.
List is stored in order.
List is mainly used to vector,arraylist,linkedlist.
Vector: is an array-based list that adds some functionality on top of the array and is thread-safe .
ArrayList: is an array-based list, non-thread-safe .
linkedlist: A list that is not array-based is equivalent to a linked list in C + +, each of which contains two things: 1. Data of the node itself; 2. Information for the next node. So when adding to the LinkedList, deleting the action doesn't have to be a lot of data movement like array-based lists.
so vector ArrayList is suitable for queries, linkedlist for adding deletes .
Set
Set the implementation base is map.
Set stores the key-value pair format data.
Set does not allow duplicates.
Set is mainly used to hashset,linkedhashset,treeset.
HashSet: no order.
linkedhashset: HashSet subclass, is a linked list, in order of insertion.
TreeSet: Naturally ordered.
Queue:
The queue is used to save the list of tasks that will be performed.
The LinkedList also implements the queue interface, which enables FIFO-first queues.
priorityqueue is used to create a priority queue for natural sorting.
The collection in Java--the main difference