How to remove the element with Iterators
807603Feb 7 2008 — edited Feb 7 2008I have a programm like this
Vector ts = new Vector();
ts.add("abc"); ts.add("abd");
Iterator it = ts.iterator();
ts.remove("abc");
it.remove();
while(it.hasNext())
{ System.out.println("val = " + it.next()); }
What is the problem if I use remove with iterator. It is giving the error java.lang.IllegalStateException. Can somebody tell me what is wrong with this.