title: Difference between add(E e) and offer(E e) of ArrayDqueue Class
body: <p>Hi I used add and offer to add my element in last pace.
  Both are returning boolean and both does not throw any exception apart from NPE.</p>
  
  <pre><code> public class ArrayDequeDemo {
  
    public static void main(String[] args) {
  
  
      // Create ArrayDeque elements.
      ArrayDeque&lt;Integer&gt; deque = new ArrayDeque&lt;&gt;();
      deque.add(10);
      deque.offer(30);
  
     }
   }
  </code></pre>
  
  <p>Both will add element in last place by returning a boolean.</p>
  
  <p><strong>JAVA IMPLEMENTATION</strong></p>
  
  <pre><code>//For Add and Offer Both
     public void addLast(E e) {
      if (e == null)
          throw new NullPointerException();
      elements[tail] = e;
      if ( (tail = (tail + 1) &amp; (elements.length - 1)) == head)
          doubleCapacity();
  }
  </code></pre>