List of usage examples for java.util Collections asLifoQueue
public static <T> Queue<T> asLifoQueue(Deque<T> deque)
From source file:Main.java
public static void main(String args[]) { Deque<Integer> deque = new ArrayDeque<Integer>(7); deque.add(1);//w ww . j av a 2s. co m deque.add(2); deque.add(3); deque.add(4); deque.add(5); // get queue from the deque Queue<Integer> nq = Collections.asLifoQueue(deque); System.out.println("View of the queue is: " + nq); }