dcsimg

How can I use two iterators to go through a collection?

Nils Kulk

Just get a separate iterator for each loop:

Collection l = ...;
for(Iterator i = l.iterator(); ...) {
   for(Iterator j = l.iterator();...) {
   }
}
About | Sitemap | Contact
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.