Stack extends Vector and synchronizes every operation for no benefit in single-threaded code, while LinkedList suffers cache-unfriendly pointer chasing and per-node object overhead; ArrayDeque is a contiguous, unsynchronized ring buffer that is faster for both stack and queue use.
For immutability, List.of returns a genuinely immutable list that also rejects nulls, whereas Collections.unmodifiableList returns a read-only view over a backing list, so if someone holds the backing list they can still mutate it underneath you. Prefer the truly immutable factory when you want a real guarantee.
- Using Stack or LinkedList for a stack or queue.
- Thinking unmodifiableList copies the data — it is a view.