title: What is the difference between poll(),pollFirst(),pollLast(),removeFirst() and remove() methods which are used on a LinkedList object in Java?
body: <p>I have a LinkedList object.</p>
  
  <p>I want to apply these 5 methods on my LinkedList object.</p>
  
  <pre><code>LinkedList&lt;String&gt; ll = new LinkedList&lt;String&gt;();
  
  1) Object o = ll.poll();
  2) Object o = ll.pollFirst();
  3) Object o = ll.pollLast();
  4) ll.remove();
  5) Object o = ll.removeFirst();
  </code></pre>
  
  <p>When I use poll(),pollFirst(),removeFirst() those are removing the first item of the list.</p>
  
  <p>Any one can tell me what happened when I use these methods on my LinkedList object? and what are the differences between these 5 methods those are applicable on a LinkedList object.</p>
  
  <p>Thanks in advance.</p>