title: java - how can iterator.next() return the first element?
body: <p>I have read about iterator.next() in oracle doc and it says: iterator.next() returns the next element in the iteration. I have this code, suppose the collection is not empty:</p>
  
  <pre><code>while ( iterator.hasNext() ){
          Card nextCard = iterator.next();
          System.out.println( nextCard );
      }
  </code></pre>
  
  <p>In the first loop, hasNext() is called and there is a pointer points to the first element, then next() is called and return the next element, it means the second element and then move the pointer to the second element, but why can i still print out the first element ?</p>