1import java.util.ArrayList;
2import java.util.Iterator;
3
4public class IteratorSample {
5 public static void main(String[] args) {
6 ArrayList<String> list = new ArrayList<String>();
7 list.add("JavaFx");
8 list.add("Java");
9 list.add("WebGL");
10 list.add("OpenCV");
11 Iterator iterator = list.iterator();
12 while(iterator.hasNext()) {
13 System.out.println(iterator.next());
14 }
15 }
16}