JavaZakariae/JavaChallenges

ConcurrentModificationException

JavaZakariae opened this issue · 0 comments

ConcurrentModificationException should be thrown when we try to execute the folowwing for loop
static void doProcess( List list ) {
for (String word:list){
if (word.equals("ik")){
list.remove(word);
}
}
}

input list contains the following String {"Hallo","goed","moest","ik","ging"};

The above code don't throw the ConcurrentModificationException .