exception - Java ConcurrentModificationException: Is it possible to add elements to a hashtable while iterating through it? -


I am repeating through a hashtable and at one point, I hashtable which is clearly giving me a concurrent correction concept I understand why I am getting the error, but is there no way around it that I can still iterate through the hashtable and combine values ​​together Can i

Create a new hashtable that you add new entries; Then when you are working again, add entries from the first table.

Alternatively, if you need it, you can leave the key in the original table.

Comments