Deque interface
suggest changeVersions
Deque was added in Java SE 6.
Introduction
A deque is a linear collection that supports insertion and removal at both ends.
The name is short for “double-ended queue” and is usually pronounced “deck”. The type is java.util.Deque, not “Dequeue”.
Most Deque implementations have no fixed limit, but the interface also allows capacity-restricted deques.
Deque extends Queue. It does not extend java.util.Stack, but the same object can be used as a FIFO queue or as a LIFO stack.
Remarks
Generics can be used with Deque.
Deque<Object> deque = new LinkedList<Object>();
When a deque is used as a queue, FIFO (First-In-First-Out) behavior results.
Deques can also be used as LIFO (Last-In-First-Out) stacks.
For more information about methods, go through this Documentation.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents