polkadot
asked on
Java Iterator next method?
In 1.4.2
Iterator itr = ...;
itr.next() gets the next object and advances the iterator? How do I get it so that it only advances when I want it to.
For instance I need to retrieve the value referenced by the iterator several times during this block of code.
Iterator itr = ...;
itr.next() gets the next object and advances the iterator? How do I get it so that it only advances when I want it to.
For instance I need to retrieve the value referenced by the iterator several times during this block of code.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can get the element with next() and then rewind it by previous()