Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsAsLifoQueueExample2 { public static void main(String[] args) { Deque
deque = new ArrayDeque
(5); deque.add(1); deque.add(2); deque.add(3); deque.add(4); deque.add(5); Queue
q = Collections.asLifoQueue(deque); System.out.println("The resultant view of the queue is: "+q); } }
Output