whats the difference between poll() and pop() for linkedlist in java?
<p>I recently found there are two similar methods for linkedlist in java API, they all delete the first node and return it. I wrote the following codes to test and they did exactly same thing.Do they really work exactly same?</p>

<pre><code>    test.add(1);
    test.add(2);
    test.add(3);
    System.out.println(test.pop());
    for(int i = 0; i &lt; test.size();i++ ){
        System.out.print(test.get(i) + " ");
    }
    System.out.println("");
    System.out.println(test.poll());
    for(int i = 0; i &lt; test.size();i++ ){
        System.out.print(test.get(i) + " ");
    }
    System.out.println("");
</code></pre>

<p>Thanks!!!</p>