List books=new ArrayList();
books.add("轻量级java");
books.add("疯狂java");
books.add("疯狂android");
for(int i=0;i<books.size();i++){
System.out.println(books.get(i));
}
Iterator it=books.iterator();
while(it.hasNext()){
String book=(String) it.next();
System.out.println(book);
if(book.equals("疯狂java")){
//it.remove();
//books.remove(book);
}
}
for(Object obj:books){
String book=(String) obj;
System.out.println(book);
}
待续