package devmanuals.com; import java.util.Deque; import java.util.ArrayDeque; public class DequeAddLast { public static void main(String args[]) { Deque dqa = new ArrayDeque(); dqa.add(11); dqa.add(12); dqa.add(13); dqa.add(14); System.out.println("Elements of previous deque are :" + dqa); System.out.println("And the size of deque : " + dqa.size()); System.out .println("Insert a new element '10' at the front of the deque"); // This method will add the element at the front of the deque. dqa.addFirst(10); System.out.println("Then the new Elements of deque are : " + dqa); System.out .println("Now insert a new element '15' at the end of the deque"); // This method will add the element at the end position of the deque. dqa.addLast(15); System.out.println("Then the new Elements of deque are : " + dqa); System.out.println("And the size of new deque = " + dqa.size()); } }