List interface: can store duplicate content;set interface: Cannot store duplicate content, repeat content relies on hashcode and equal two methods to differentiate;queue: Queues;SortedSet Interface: Sorts the data in the collection;List Interface:List sub-class: Arraylist,vectorthe difference between ArrayList and vectors:LinkedList class and queue interfacelinedlist Linked list Operation classthe queue interface is a sub-interface of collectionset Interface:The set interface is a sub-interface of the collection interface, but unlike the collection or list interface, the set cannot add duplicate elements. The main method of set is consistent with collectioninstance of the set interface cannot be output bidirectional like the list interfaceSet sub-class:Hash Storage:HashSetordered storage: TreeSetThe set is unordered and the list is sorted in the order in which it is stored. object ordering must implement the Commparable interface to sort the object data in the Commpareto methodoperation of the collection class:IteartorListiteratorforeach OutputEnumeration OutputNote:when using the output of the collection must form the following ideas, as long as it is encountered in the collection of data operations, you must use the iterator interfaceoperating principle of the iterator interface:Interator is a specialized iterative output interface, the so-called iterative output is to determine the elements of each one, to determine whether there is content, if it is taken out. iterator standard notation:Iterate Delete elements:Note the point:The list interface has a Delete method: RemoveThe problem occurs if you use the Remove from list to perform the removal during the use of the output. when using the iterator output, do not use the Remove method inside the collection class, only the Remove method inside the iterator is used. Listiteratoriterator sub-interface, iterator is mainly to achieve the front-to-back of the single output, if the implementation from the back to the front or the back of the two-way output, you need to use a sub-interface ListiteratorNote: Only the list interface has an instantiation operation for the Listiterator interface. Move forward before you can perform a backward operation.Map Interface:Collection and Map differences: Collection operation is an object, map is a pair of objects, Key-->value form to store the sub-class map: HashMap: Unordered storage, new operation class, key cannot repeat Hashtable, Unordered storage, old operation class, key does not allow duplicate TREEMAP: The map collection can be sorted, sorted by key in the collection, key does not allow repetition. Weakhashmap: Weak reference map collection, when no write content in the collection is no longer in use, you can clear out useless data and use GC recycling. Identityhashmap,key can duplicate the map collection. The difference between HashMap and hashtable: Map interface Output: The order is as follows: Use the Foresh output:Identityhashmap class:If you want key can be repeated can use Identityhashmapsortedmapsortedset is TreeSet implementation interface SortedMap is the implementation of TreeMap, is a can sort of mapcollections, Collection Class helper classProvides help methods related to collection classes: Emptylist () Emptyset () AddAll () Replayall ()Stack , StackThe stack is stored by the advanced data structure, and the new element is pressed against the old element; Stack is the subclass of the vector push into the stack pop stack
Java review--collection classes