LinkedList and ArrayDeque both implement Deque and produce the same sequence of elements, but LinkedList allocates a node object with two pointers per element while ArrayDeque uses one resizable array; LinkedList also implements List, which ArrayDeque deliberately does not.
Deque<Integer> linked = new LinkedList<>();
Deque<Integer> array = new ArrayDeque<>();
for (int i = 0; i < 5; i++) {
linked.addLast(i);
array.addLast(i);
}
System.out.println("LinkedList as Deque: " + linked);
System.out.println("ArrayDeque: " + array);
System.out.println("LinkedList implements List too: " + (linked instanceof List));
System.out.println("ArrayDeque implements List: " + (array instanceof List));
LinkedList as Deque: [0, 1, 2, 3, 4]
ArrayDeque: [0, 1, 2, 3, 4]
LinkedList implements List too: true
ArrayDeque implements List: false
Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.
Published 2026-09-27