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:
while ( iterator.hasNext() ){
Card nextCard = iterator.next();
System.out.println( nextCard );
}
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 ?