Back to blog
Ordered collection Allows duplicate elements Access by index Fast random access Ideal for read-heavy scenarios Use case: transaction history Fast insertions and removals Slower index access Use case: processing steps in a workflow Use List when order is meaningful ArrayList → fast reads and index access LinkedList → frequent insertions and removals
January 9, 2026•6 min read•Marina
Java Collections in Real Systems | Part 2: List
JavaCollectionsList
Java Collections in Real Systems | Part 2: List

If Set is about uniqueness, List is about order and position.
Duplicates are allowed and index-based access becomes part of the contract.
List
ArrayList
List<String> transactions = new ArrayList<>();
transactions.add("TX1001");
transactions.add("TX1002");
transactions.add("TX1003");
transactions.add("TX1002"); // duplicate allowedLinkedList
List<String> workflowSteps = new LinkedList<>();
workflowSteps.add("VALIDATE");
workflowSteps.add("AUTHORIZE");
workflowSteps.add("SETTLE");
workflowSteps.add("AUTHORIZE"); // duplicate allowedThink
If you want the big-picture comparison between List, Set, and Map, read the intro:
List, Set, and Map: Key Differences in Java Collections.
Previous in the series:
Java Collections in Real Systems | Part 1: Set.
Next in the series: