The Javadoc tells you :
Answer from Eran on Stack Overflowpoll() : Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), or returns null if this deque is empty.
remove() : Return the head of this list, throws NoSuchElementException if this list is empty
pollFirst() is the same as poll().
pollLast() return the last element of this list, or null if this list is empty
removeFirst() is the same as remove()
The Javadoc tells you :
poll() : Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), or returns null if this deque is empty.
remove() : Return the head of this list, throws NoSuchElementException if this list is empty
pollFirst() is the same as poll().
pollLast() return the last element of this list, or null if this list is empty
removeFirst() is the same as remove()
I think the naming of the methods is quite obvious telling what do they do.
Only bit confusing thing is why 2 methods doing same thing in poll() and pollFirst(). For that see below -
LinkedList implements two interfaces - Queue and Deque. And Deque extends from Queue. Now, Deque has defined the method - Deque#pollFirst() and inherited the method - Queue#poll(). So, LinkedList has basically these two methods defined for the two interfaces it implements.
LinkedList.poll() - Retrieves and removes the head (first element) of this list
To get this behavior with an ArrayList, you must get the first entry, then remove it.
e.g.
Object obj = arrayList.get(0); // retrieve the head
arrayList.remove(0); // remove the head
There is no such method in Arraylist. if you want to retrieve and remove first element simply go for
ArrayList.get(0);
ArrayList.remove(0);
for more info see Docs