I\'m finding conflicting advice over the best way to avoid a ConcurrentModificationException while doing this:
ConcurrentModificationException
List Apples = appleC
Yes, use an Iterator. Then you could use its remove method.
for (Iterator appleIterator = Apples.iterator(); appleIterator.hasNext();) { Apple apple = appleIterator.next(); if (apple.isTart()) { appleIterator.remove(); } } }