why do we have to create a copy of the set in the second method?
Dyskutowane
Komentarze (3)
- Popularne
- Najnowsze
- Najstarsze
Musisz się zalogować, aby dodać komentarz
Anonymous #11301956
28 marca 2023, 16:42
Nie ma możliwości usuwania elementów z kolekcji podczas iterowania po niej korzystając z pętli for each.
https://javastart.pl/baza-wiedzy/wyjatki/concurrentmodificationexception
+1
iNUDiEZ#1996
16 lutego 2023, 19:03
You need to create a copy to work on it but edit your original set and return it next. I guess u mind that ;)
0
Thomas
15 lutego 2023, 21:48
I neither created a set nor a copy of a set in the second method. Maybe post code to illustrate what you mean.
0