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();...) {
   }
}
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact