I would like to delete an item from my arrayList while iterating through it, and the ArrayList
has a type class Members. I have read multiple examples of how to fix this problem however none have worked, the ConcurrentModificationException
is still thrown.
Iterator<Members> itr = members.iterator();
while (itr.hasNext()) {
Members foundMember = itr.next();
if (foundMember.equals(member)){
itr.remove();
}
}