This Java tip illustrates a method of implementing a Queue. Java provides LinkedList class which may be implemented as a queue. Developers may store their data in a queue and retrieve their data in First in First out(FIFO) manner.

     LinkedList queue = new LinkedList();
    // In queue data is added in the end
    // Data is retrieved from the head of queue
    Object o = queue.removeFirst();
    // In case multiple threads are using a queue there is 
    // a need to synchronize methods
    queue = (LinkedList)Collections.synchronizedList(queue);