- import java.util.Iterator;
- import java.util.Vector;
- public class test1 {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Vector<String> v = new Vector();
- v.add("aaa");
- v.add("bbb");
- v.add("ccc");
- Iterator<String> it = v.iterator();
- for(String s:v)
- {
- if(s.equals("bbb"))
- v.remove("bbb");
- //System.out.println(s);
- }
- for(String s:v)
- System.out.println(s);
- }
- }
本文出自 “阿凡达” 博客,请务必保留此出处http://shamrock.blog.51cto.com/2079212/702533