Online Java Compiler By
JavaTpoint.com
import java.util.ArrayDeque; import java.util.Deque; public class JavaDequepollExample3 { public static void main(String[] args) { Deque
deque = new ArrayDeque<>(); deque.offer(34); deque.offer(65); deque.offer(59); deque.offer(95); deque.offer(68); int val = deque.poll(); System.out.println("The first string value is : "+val); System.out.println("The final deque is given as : "); for (Integer integer : deque) { System.out.println(integer); } } }
Output