title: Differnce between addfirst and offerFirst methods in ArrayDeque
body: <p>Have tried out a sample program to understand the difference between <code>addFirst</code> and <code>offerFirst</code> methods in <code>ArrayDeque</code> of Java 6. But they seem to be same, any suggestions?</p>
  
  <pre><code>public void interfaceDequetest()
  {
          try{
          ArrayDeque&lt;String&gt; ad = new ArrayDeque&lt;String&gt;();
          ad.addFirst("a1");
          ad.offerFirst("o1");
          ad.addFirst("a2");
          ad.offerFirst("02");
          ad.addFirst("a3");
  
          System.out.println("in finally block");
  
          for (String number : ad){
              System.out.println("Number = " + number);
          }
  }
  </code></pre>