Queue in Java using LinkedList - FIFO

by rajesh 2009-12-30 16:31:37

Implementing a Queue in Java using LinkedList

An Example for building First in First out(FIFO) queue.


    LinkedList queue = new LinkedList();
    
    // To add an object in queue
    queue.add(object);
    
    // Retrieving and removing first object from queue
    Object o = queue.removeFirst();
    



Tagged in:

1562
like
0
dislike
0
mail
flag

You must LOGIN to add comments