package devmanuals.com; import java.util.Deque; import java.util.LinkedList; public class DequeAddFirst { public static void main(String args[]) { Deque dq = new LinkedList(); dq.add(11); dq.add(12); System.out.println("Elements of previous deque are :" + dq); System.out.println("And the size of dqueue : " + dq.size()); System.out .println("Now insert a new element '10' at the front of the deque"); // This method will add the element at the front of the deque. dq.addFirst(10); System.out.println("Then the new Elements of dqueue are : " + dq); System.out.println("And the size of new dqueue = " + dq.size()); } }