ConcurrentModificationException when using iterator and iterator.remove()

前端 未结 4 1966
旧时难觅i
旧时难觅i 2021-01-13 16:30
    private int checkLevel(String bigWord, Collection dict, MinMax minMax)
{
    /*value initialised to losing*/
    int value = 0; 
    if (minMax ==          


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-13 16:46

    When using a for each loop you are not allowed to modify the Collection you are iterating inside the loop. If you need to modify it, use a classic for loop

提交回复
热议问题