Java tutorial
import java.util.Arrays; import java.util.Iterator; public class Main { public static void main(String[] args) throws Exception { Iterator it = Arrays.asList("a", "b", "java2s.com").iterator(); while (it.hasNext()) { String key = it.next().toString(); System.out.println(key); } } }