First, the basic concept
1.collecction: A sequence of independent elements that obey one or more rules. Lists must hold elements in the order in which they are inserted; Set cannot have duplicate elements; queue determines the order in which objects are produced by queuing rules
2,map: Mapping table, a set of pairs of key-value pairs of objects, allowing the use of keys to find values
1 PackageHolding;2 ImportJava.util.*;3 4 Public classsimplecollection {5 Public Static voidMain (string[] args) {6collection<integer> C =NewArraylist<integer>();7 for(inti = 0;i < 10; i++){8 C.add (i); 9 }Ten for(Integer i:c) { OneSystem.out.print (i + ","); A } - } - the}
Ii. Classification (pending edit)
Third, List
In the case of the linked list data structure in C/E + +, there are two kinds of physical storage structures, namely, array list and chain list, both of which have advantages and disadvantages.
1,ArrayList: Can randomly access its elements, because the array subscript can randomly access any element. However, if you want to insert or delete, you must move the element, so the insertion or deletion of elements is slower.
2.LinkedList: Because it is a chain-based data structure, inserting and deleting without moving a large number of elements, faster. But to access an element, you need to traverse the linked list, making it slower to access the element.
Java Programming Ideas Learning Note 11: Holding objects