title: Explanation in arraydeque push method in java
body: <p>I am new to java, Im learning from oracle docs.</p>
  
  <p>So now i am getting started util package and corresponding classes and interfaces.</p>
  
  <p>According to ArrayDeque class,I want know, how to use push method, foe that i refered this <a href="http://www.tutorialspoint.com/java/util/arraydeque_push.htm" rel="nofollow">http://www.tutorialspoint.com/java/util/arraydeque_push.htm</a>.</p>
  
  <p>In this i just confused how to get output..</p>
  
  <p>And also, </p>
  
  <blockquote>
    <p>import java.util.ArrayDeque; import java.util.Deque;</p>
  </blockquote>
  
  <p>Here ArrayDeque is class and Deque is interface,.. is this way i should write for every time  when use other methods of ArrayDeque class?</p>
  
  <p>Or</p>
  
  <p>May i use <code>import java.util.*;</code> instead of using <code>import java.util.ArrayDeque;</code> and <code>import java util.Deque;</code> ?</p>
  
  <p>PROGRAM:</p>
  
  <pre><code>package com.tutorialspoint;
  
  import java.util.ArrayDeque;
  import java.util.Deque;
  
  public class ArrayDequeDemo {
     public static void main(String[] args) {
  
     // create an empty array deque with an initial capacity
     Deque&lt;Integer&gt; deque = new ArrayDeque&lt;Integer&gt;(8);
  
     // use add() method to add elements in the deque
     deque.add(25);
     deque.add(30);
     deque.add(35);
  
     // adding elements using push() method
     deque.push(10);
     deque.push(15);
  
     System.out.println("Printing Elements after using push operation:");
     for (Integer number : deque) {
     System.out.println("Number = " + number);
     }
     }
  }
  </code></pre>
  
  <p>And output is:</p>
  
  <pre><code>Number = 25
  Number = 30
  Number = 35
  Printing Elements after using push operation:
  Number = 15
  Number = 10
  Number = 25
  Number = 30
  Number = 35
  </code></pre>
  
  <p>Anybody guide me , working of this method, if i got a idea means.. i m sure i will workout other methods and all easily.</p>
  
  <p>Thanks,</p>