I am getting the following error
java purse transfer method giving Exception in thread "main" java.util.ConcurrentModificationException error
when executing the following method:
public void transfer1(Purse p) {
for (String coin : newPurse) {
newPurse.add(coin);
p.newPurse.clear();
}
}