Java Collection Tutorial - Java BlockingDeque .removeLastOccurrence (Object o)








Syntax

BlockingDeque.removeLastOccurrence(Object o) has the following syntax.

boolean removeLastOccurrence(Object o)

Example

In the following code shows how to use BlockingDeque.removeLastOccurrence(Object o) method.

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
/*  www . j  av  a2s .  c om*/
public class Main {
  public static void main(String[] argv) throws Exception {
    int capacity = 10;
    BlockingQueue<Integer> queue = new ArrayBlockingQueue<Integer>(capacity);

    for (int i = 0; i < 10; i++) {
      queue.add(i);
    }
    
    //System.out.println(queue.removeLastOccurrence(new Integer(0)));
  }
}