Extends the Queue interface.
Interface for a double-ended queue.
Elements can be added and removed from both ends.
Implementing classes are ArrayDeque, LinkedList.
Extending class is BlockingDeque.
For creating instances, use constructors of classes which implements the Deque interface.
EXAMPLE FOR DEQUE:
These implementations can use declared methods in the Deque interface.
The Deque class provides right implementation of a stack.
The Stack class provides implementation of a stack as well however methods of it are synchronized, using it is not recommended.
Methods of Deque providing stack functionality follow.
EXAMPLE FOR USING ARRAYDEQUE VIA DEQUE: