A collection of related knowledge:

A frame set

  Generally look at a set of frame part, as FIG.

  * There List interface and Set-interface Collection interface, as well as interface called Map

  * Iterator interface is built iterator can traverse operations on classes that implement the interface

  * Collections and Arrays are two kits, a method for operating a collection or array

Two, ArrayList collection

  1, features: Elements orderly, not the only, using an array structure to achieve List interface, traverse, high random search efficiency, but lower insert or delete elements of efficiency

  2, create ways: ArrayList arraylist = new ArrayList ();

  3, ArrayList implements an array of variable size

Three, LinkedList collection

  1, Features: The only element not ordered, linked list structure to achieve, insert or delete elements of high efficiency, but the low efficiency of traversing

  2, create ways: LinkedList linkedList = new LinkedList ();

  3, the following table shows the class common method LinkedList

  

Four, HashSet collection

  1, Set a unique set of unordered interface memory object

  2, HashSet hash using a hash table to store data, a disorder, can not use the Collections.sort () method to sort

  3, Set interface does not exist get () method, the general () or enhanced by the iterator Interator implemented for traversal

  4, HashSet weight to be achieved by the methods and HashCode equals ()

Five, HashMap collection

  1, Map interfaces dedicated to storing a set of key-value pairs function, key-value key-value pairs

  2、创建HashMap集合:HashMap hashmap =new HashMap();

  3, Map interface to common methods

  

  

 

Guess you like

Origin www.cnblogs.com/daguoshi/p/10988654.html
Recommended