1. Set of systems:
----------| Collection root interface for single-column collections
--------------| List if it is a collection class that implements the list interface, the collection class has the characteristics: orderly, repeatable.
--------------| Set if it is a set interface implementation of the collection class, the collection class has the characteristics: unordered, non-repeatable.
Order: The order of the set does not refer to the natural order, but refers to the sequence in which the elements are added in the same order.
Unique methods in the list interface:
Add to
Add (int index, E Element)
AddAll (int index, COLLECTION<? extends e> c)
Get:
Get (int index)
IndexOf (Object o)
LastIndexOf (Object o)
sublist (int fromIndex, int toindex)
Modify:
Set (int index, E Element)
Iteration
Listiterator ()
Import Java.util.arraylist;import Java.util.list;public class Demo01 {public static void main (string[] args) {//TODO auto-generated Method Stub list = new ArrayList (), List.add ("Zhang San"), List.add ("John Doe"), List.add ("Harry"), List.add ("Zhao Liu"), List.add ("Zhao Liu"); System.out.println ("Elements of the collection:" + list);}}
Execution results
Elements of the collection: [Zhang San, John Doe, Harry, Zhao Liu, Zhao Liu]
2.
List of Java