Back to Lessons

List Implementations ArrayList LinkedList

April 5, 2026

List Interface

Ordered collections allowing duplicates and nulls.

List Examples

List arrayList = new ArrayList<>();
List linkedList = new LinkedList<>();

arrayList.add("Java");
arrayList.add("Python");

arrayList.remove(0); // Removes first element
arrayList.get(0);    // Access by index

Key Points

  • ArrayList: fast random access, slow insertion/deletion.
  • LinkedList: fast insertion/deletion, slow random access.
  • Enhanced for-each: for(String s : list).
  • Iterator for safe removal during iteration.