public class Test{
public static void printColl(Collection<Object> coll){
for(Iterator<Object> iterator = coll.iterator();iterator.hasNext();){
Object object = (Object)iterator.next();
System.out.println(object);
}
}
public static void main(String[] args){
printColl(new Vector<String>());//为什么编译会报错?什么原因?
}
} |
|