package com.cz.test.util.collection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
public class Test {
public static void main(String[] args) {
Collection con=new ArrayList();
con.add("java");
con.add("C++");
con.add("C");
System.out.println(con.contains("java"));
//遍历
Iterator s=con.iterator();
while(s.hasNext()){//返回boolean值,
System.out.println(s.next());//一个一个输出
}
}
}