iterator

 ArrayList<Object> c = new ArrayList<>();
String s="abc";
c.add(s);
c.add("abc");
c.add("lps");
c.add(123);
c.add("hello");
System.out.println(c);
System.out.println();
Iterator<Object> ite = c.iterator();
while (ite.hasNext()){
System.out.println(ite.next());
}
}
posted @ 2022-03-17 13:18  刘品水  阅读(33)  评论(0编辑  收藏  举报