Mega Code Archive

 
Categories / Java / Collections Data Structure
 

Implementing a Queue with LinkedList

import java.util.LinkedList; public class Main {   public static void main(String[] argv) throws Exception {     LinkedList queue = new LinkedList();     Object object = "";     // Add to end of queue     queue.add(object);     // Get head of queue     Object o = queue.removeFirst();   } }