ArrayList and LinkedList both implement the List interface. The List interface extends the Collection interface and defines a collection for storing elements in a sequential order. The ArrayList is probably the most frequently used list form.
[Instructor] The ArrayList data type.…Both the ArrayList and the LinkedList…both implement the List interface.…The ArrayList is probably the most frequently…use form of a list.…ArrayList list approach to implementing the List…interface is simply to define an object array…and increase the size of that array as necessary…to support the number of elements contained…within the collection.…ArrayList can contain duplicate elements.…You can also add null values to an ArrayList.…
An ArrayList isn't inherently thread safe,…so if you create an instance that's being used…by multiple threads, you're responsible for…synchronizing modifications to the list.…By implementing the List interface, it adds…position oriented operations, which is useful…to quickly access a specific element, based…on it's index position in the list.…This feature also allows the developer to…add and remove elements at a specific index or…specific position and even find the index of the…first occurrence of an element in the list.…
It is possible to specify the initial capacity of…
In this course, explore data structures in the Java language. Follow Peggy Fisher as she introduces you to several types of commonly-used data structures in Java. Peggy explores ArrayLists and LinkedLists, both of which implement the List interface, which extends the Collection interface and allows you to access list elements in a specific order. She also goes into the Vector, Stack, and Queue collection classes. To help you better understand these new concepts, Peggy wraps up the course with a challenge—creating a grocery list—and provides a solution for that challenge.
- Reviewing the types of data structures
- Working with the Collection interface and Iterable interface
- Working with ArrayLists and LinkedLists
- Using the Vector, Stack, and Queue collection classes