i know that we shouldn't modify the ArrayList during iteration.
But i'm using Iterator to iterate over list and iterator.remove() to remove the element but still results in ConcurrentModification Exception.
My program is not multithreaded.
I've many arraylist [class contains it and i'm processing many array of objects]
for(int i=0;i<obj.length;i++)
{
if(k==i) continue;
it = obj[i].arraylist.iterator();
while(it.hasNext()){
value = it.next();
if(condn) {
it.remove();
obj[k].arraylist.add(value);
//k and i are not same
}
}
}