I haven't submitted the task for validation yet because I already know by test-running it that it won't work. Also I used family members DOB for all the dates so I kinda don't want to post that here. Also I can't post using the code tag because the HashMap uses symbols that get treated as BB code. So here is a screenshot of current removeAllSummerPeople:
I'm getting a ConcurrentModificationException. I know what that is, but I also thought using an iterator was supposed to get around that problem.
ConcurrentModificationException (yes, I'm using an iterator)
Resolved
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Gellert Varga
13 July 2021, 22:05solution
Use only the itr object to delete an item.
You are also using the itr object to get the next item, so try to use itr also to delete an item.
The itr object will be able to handle the situation.
If you delete directly from the map, it will interfere with the working of itr object, --> Exception.
+2
Justin Smith
13 July 2021, 22:36
Thank you. That worked.
0