Mega Code Archive

 
Categories / Java Book / 005 Collection
 

0284 Poll, pop and push element to a LinkedList

E poll() Retrieves and removes the head (first element) of this list E pollFirst() Retrieves and removes the first element of this list, or returns null if this list is empty. E pollLast() Retrieves and removes the last element of this list, or returns null if this list is empty. E pop() Pops an element from the stack represented by this list. void push(E e) Pushes an element onto the stack represented by this list.