Can anyone explain the concurrent modification exception in java with example? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Can anyone explain the concurrent modification exception in java with example?

10th Dec 2019, 7:28 AM
goutham thota
goutham thota - avatar
2 Respostas
+ 6
When one thread iterate the collection and other thread try to modify that collection then this exception comes. Check here with example: https://www.journaldev.com/378/java-util-concurrentmodificationexception
10th Dec 2019, 7:34 AM
AĶ¢J
AĶ¢J - avatar
+ 5
šŸ…°šŸ…¹ - ÉŖ'į“ į“„Ź€ÉŖį“ÉŖÉ“į“€ŹŸŹŸŹ É¢į“į“į“…! It's not just with multi-threads. This can occur on the same thread when attempting to add or remove an item in a list while iterating through the list.
10th Dec 2019, 7:45 AM
David Carroll
David Carroll - avatar