import java.util.ArrayList;

import java.util.Collection;

import java.util.Iterator;


public class PracCollection {

public static void main(String[] args) {

Collection<String> list = new ArrayList<>();

list.add("aaa");

list.add("bbb");

list.add("ccc");

Iterator<String> iter = list.iterator();

while(iter.hasNext()){

System.out.println(iter.next());

}

}

}