ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Keeping Up with the Java Joneses
Subject:   Lists and generics
Date:   2004-08-18 15:17:06
From:   jleech
Response to: Lists and generics

You can use an Iterator in a for loop.

for(Iterator <String> i = strings.iterator(); i.hasNext(); ) {
if (foo(i.next())) i.remove();

--but that's not the point. The point is that it
--should be possible to remove things from a list
--via the for-loop