About 8,760,000 results
Open links in new tab
  1. Best implementation of Java Queue? - Stack Overflow

    Jun 22, 2012 · Queue<String> queue = new LinkedList<String>(); it should be ok,as this is heads-up to users that insertions should occur only at the back and deletions only at the front. You …

  2. How do I instantiate a Queue object in java? - Stack Overflow

    Queue in Java is defined as an interface and many ready-to-use implementation is present as part of JDK release. Here are some: LinkedList, Priority Queue, ArrayBlockingQueue, …

  3. queue - Enqueue, Dequeue and ViewQueue in Java - Stack Overflow

    Java queues don't have enqueue and dequeue methods, these operations are done using the following methods: Enqueuing: add(e): throws exception if it fails to insert the object offer(e): …

  4. Where is the Queue class in the Java Collections?

    Apr 29, 2009 · A Queue is simply a way to look at a collection, so many collections may implement it. As well, things that act like collections but with specific other logic (like thread …

  5. java - How do I use a PriorityQueue? - Stack Overflow

    Mar 25, 2009 · How do I get a PriorityQueue to sort on what I want it to sort on? Also, is there a difference between the offer and add methods?

  6. java - FIFO based Queue implementations? - Stack Overflow

    Apr 18, 2012 · Queue is an interface that extends Collection in Java. It has all the functions needed to support FIFO architecture. For concrete implementation you may use LinkedList. …

  7. What is the difference between the add and offer methods in a …

    This code creates a Queue with a capacity of 2 using a LinkedList and adds elements 1 to 3 to the queue. It shows the difference between the add and offer methods when the queue reaches …

  8. Which concurrent Queue implementation should I use in Java?

    I have 2 scenarios, one requires the queue to support many producers (threads using it) with one consumer and the other is the other way around. I do not understand which implementation to …

  9. Java Collections (LIFO Structure) - Stack Overflow

    I am looking in the Collections framework of Java for a LIFO Structure (Stack) without any success. Basically I want a really simple stack; my perfect option would be a Deque, but I am …

  10. java - Producer/Consumer threads using a Queue - Stack Overflow

    Feb 25, 2010 · If you need fast in-memory queues use one of the impementations of java's Queue. If you need to support java 1.4 or earlier, use Doug Lea's excellent concurrent package.