List and ArrayList

List is an ordered collection, accessible by index, that accepts duplicates. ArrayList implements it with a resizable array (fast index access) and LinkedList with a linked list. List.of(...) creates an immutable list; modifying it throws UnsupportedOperationException.

Example

List<Integer> l = List.of(1, 2, 3);
int premier = l.get(0);

Related concepts

The whole glossary