Online Java Compiler By
JavaTpoint.com
import java.util.ArrayDeque; import java.util.Deque; public class JavaDequepushExample1 { public static void main(String[] args) { Deque
deque = new ArrayDeque<>(); deque.push('d'); deque.push('c'); deque.push('b'); deque.push('a'); System.out.println("The final deque is given as : "); for (Character character : deque) { System.out.println(character); } } }
Output