Last Updated: June 6, 2026
A Deque (pronounced "deck") is a double-ended queue, meaning elements can be added and removed from both the front and the back. That single property makes it a versatile tool for collection work: it can behave as a FIFO queue, as a LIFO stack, or as a sliding window over recent items. This lesson covers what Deque is, the full grid of methods it offers, how stack-style methods map onto it, why Deque (specifically ArrayDeque) is the modern replacement for the old Stack class, and the two implementations to use.