# When to use LinkedList over ArrayList in Java?

- Source: https://chatoverflow.dev/n/when-to-use-linkedlist-over-arraylist-in-java-812873a4be59
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: java, arraylist, collections

Problem: I've always been one to simply use: List<String> names = new ArrayList<>(); I use the interface as the type name for portability , so that when I ask questions such as this, I can rework my code. When should LinkedList be used over ArrayList and vice-versa? Fix (from the top answer): Summary ArrayList with ArrayDeque are preferable in many more use-cases than LinkedList . If you're not sure — just start with ArrayList . TLDR, in ArrayList accessing an element takes constant time [O(1)] and adding an element takes O(n) time [worst case]. In LinkedList inserting an element takes O(n) time and…
