What changed in Java 21
Java 21LTS1 change across 1 question — each with the behaviour it replaced, because “and how did it work before?” is the follow-up.
When would you use LinkedList instead of ArrayList?
SequencedCollection gives every List getFirst(), getLast(), addFirst(), addLast() and reversed() (JEP 431).
Before: list.get(0) and list.get(list.size() - 1), and LinkedList had getFirst()/getLast() that ArrayList did not — one of the few remaining reasons people reached for it.