- import java.util.*;
- public class CollectionDemo {
- public static void main(String[] args) {
- Collection co=new ArrayList();
- co.add("花");
- co.add("千");
- co.add("骨");
- System.out.println(co);
- for(Iterator it=co.iterator();it.hasNext();){
- System.out.println(it.next());
- }
- }
- }
复制代码 |
|