Exception in thread "main" java.util.ConcurrentModificationExceptions

  用java的Map時候碰到這樣一個錯誤Exception in thread "main" java.util.ConcurrentModificationExceptionjava 我在遍歷Map(用迭代器)的時候刪除了某些元素,而後調用迭代器是時候就觸發了這個錯誤,我就看一下源碼,緣由是Map和Iterator中維持了這樣一個遍歷modcount,用來記錄Map和Iterator中修改數據
相關文章
相關標籤/搜索