View RSS Feed

Algorithm and Data Structure

Java Queue Implementations

Rate this Entry
by , 02-19-2012 at 08:02 AM (861 Views)
Collection Interface’s subtype is Queue. In the Queue interface, collection interface methods are present automatically.

Queue interface instance can’t be created. Queue interface concrete implementations are required. In Collections API, the available Queue implementations are as following. Among them, one can make a choice:
  • java.util.PriorityQueue
  • java.util.LinkedList

LinkedList is a considered to be a standard queue implementation.

Elements are stored internally by PriorityQueue in accordance with their natural order or in accordance in which a Comparator is passed to PriorityQueue.

In java.util.concurrent package, Queue implementations are also present.

How a Queue instance is created is explained in these given examples:
Java Code: This is the code to explain Java Queue Implementations
Queue queueA = new LinkedList();
Queue queueB = new PriorityQueue();

Submit "Java Queue Implementations" to Facebook Submit "Java Queue Implementations" to Digg Submit "Java Queue Implementations" to Submit "Java Queue Implementations" to StumbleUpon Submit "Java Queue Implementations" to Google