Have tried out a sample program to understand the difference between addFirst and offerFirst methods in ArrayDeque of Java 6. But they
the source code of offerFirst :
public boolean offerFirst(E e) {
addFirst(e);
return true;
}
And addFirst
public void addFirst(E e) {
if (e == null)
throw new NullPointerException();
elements[head = (head - 1) & (elements.length - 1)] = e;
if (head == tail)
doubleCapacity();
}
offerFirst returns true, thats the only difference ...