sample.java
public static void main(String[] args) {
List<String> li = new ArrayList();
li.add("a1");
li.add("a2");
Iterator it = li.iterator();
while (it.hasNext()) {
System.out.println(it.next());
}
}
実行結果
a1
a2