* ** List interface An ordered collection (also known as a sequence ). unlike sets, lists typically allow duplicate elements. the List interface is a Collection sub-interface. The elements in the container class that implements the List interface are ordered and can be repeated. Each element in the List container corresponds to an integer sequence number, which records its position in the container. You can obtain the elements in the container according to the sequence number. ArrayList -- List objects List implemented by arrays at the underlying layer -- List objects List implemented by linked lists at the underlying layer. Common Methods: 1. object get (int index) Returns the element at the specified position in this list. returns the element 2 at the specified position in this list. object set (int index, Object element) Replaces the element at the specified position in this list with the specified element Replaces the element at the specified position in the list with the specified element. 3. void add (E e) Appends the specified element to the end of this list to append the specified element to the end of this list. 4. void add (int index, E element) Inserts the specified element at the specified position in this list Insert the specified element into the specified position in this list. object remove (int index); Removes the element at the specified position in this list. removes an element from the specified position in the list. 6. int indexOf (Object o) Returns the index of the first occurrence of the specified element in this list, if-1 7.int lastIndexOf (Object o) Returns the index of the last occurrence of the specified element in this list is not returned. returns the location index of the last occurrence of the specified object in the list. * ** Set interface A collection that contains no duplicate elements. A collection that does not contain duplicate elements. More formally, set does not contain elements e1 and e2 that meet e1.equals (e2), and can contain at most one null element. The main implementation class HashSet can be used to filter data. For the Set method, refer to the API *** to compare the selected data structure-Read efficiency and change efficiency-Array-fast reading and slow modification (when the program reads a lot) Linked-slow reading, fast modification (many changes to the program) Hash-between the two