List | An ordered collection that allows duplication of elements; the implementation is not synchronized, and if multiple threads access a List instance and at least one of them structurally modifies the table (adds or removes elements), then it needs to maintain external synchronization ; Generally done by synchronizing the object that naturally encapsulates the list, such as: Collections.synchronizedList() to wrap the list; |
ArrayList | An implementation of a variable-sized array of the List interface that implements all optional list operations and allows all elements including null, |
LinkedList | The linked list implementation of the List interface allows elements to be null, implements all optional list operations, and also provides implementations for get, remove, and insert at the beginning and end of the list; |
ArrayList al = new ArrayList();
Iterator it = al.listIterator();//Can operate on the iterated objects;
while(it.hasNext())
{
String str = (String)it.next();
if(str == "abcd")
it.remove();
System.out.println(str);
}
al:
[abc,abcd,abcde]-->[abc,abcde]