

So it inherits the properties of the Deque interface.

BlockingDeque such as BlockingQueue is a blocking queue, but bidirectional. Implementing classes of BlockingQueue interface: ArrayBlockingQueue, DelayQueue, LinkedBlockingDeque, LinkedBlockingQueue, LinkedTransferQueue, PriorityBlockingQueue, SynchronousQueue.īlockingDeque is a subinterface for BlockingQueue. Standard Blocking Queues include LinkedBlockingQueue, SynchronousQueue, and ArrayBlockingQueue. Sure, the concept of "full queue" implies that the queue has a limited size, which is usually specified in the constructor.
JAVA QUEUE LINKED LIST FULL
Similarly, when a thread tries to put elements into a full queue, it waits until some other thread takes the elements out of the queue to get free space for the elements. When a thread tries to get items from an empty queue, it waits until some other thread puts the items into the queue. thread is trying to put elements in the full queue.thread is trying to get elements from an empty queue.Let's take a glimpse at these groups.ĭequesDeque means Double- Ended Queue and supports addition or removal from either tail of the data as a queue (first-in-first-out/FIFO) or from the head as another popular data structure called stack (last-in-first-out/LIFO).Ĭlasses that implement Deque Interface: ArrayDeque, ConcurrentLinkedDeque, LinkedBlockingDeque, LinkedList.īlocking QueuesA blocking queue is a queue that blocks a thread in two cases: You may divide them into 3 groups: Deques, Blocking Queues and Transfer Queues with BlockingDeque belonging to the two first. Subinterfaces of Java Queue Queue interface is inherited by 4 subinterfaces – BlockingDeque, BlockingQueue, Deque, TransferQueue. Object element() – retrieves, but doesn’t remove an element from the head of the queue.Object peek() – retrieves, but doesn’t remove an element from the head of the queue.


Queue data structureA Queue is a linear abstract data structure with the particular order of performing operations - First In First Out (FIFO). After that, we take a closer look at the most important implementations and learn them with examples. Also, what implementations of Queue are in Java language. You’ll find out what Queue data structure is, how it is represented in Java, what methods are the most important for all queues. Here we are going to discuss the Java Queue interface.
