Iterator iter = names.iterator(); while (iter.hasNext()) { String name = (String) iter.next(); //do something here }