Collection c=new ArrayList();
c.add("abc");
c.add("efg");
c.add("fgh");
//通过集合对象获取迭代对象
Iterator it=c.iterator();
while(it.hasNext()){
String s=(String) it.next();
System.out.println(s);
}
Collection存储字符串并遍历
最新推荐文章于 2024-02-27 11:27:12 发布