Online Java Compiler By
JavaTpoint.com
import java.util.ArrayDeque; import java.util.Deque; public class JavaDequepopExample2 { public static void main(String[] args) { Deque
deque = new ArrayDeque<>(); deque.offer(67f); deque.offer(55f); deque.offer(78f); deque.offer(77f); Float val = deque.pop(); System.out.println("The first number which has been removed is : "+val); System.out.println("The final deque is given as : "); for (Float float1 : deque) { System.out.println(float1); } } }
Output