ConcurrentModificationException
Në shqip përdoret i njëjti emër.
ShpjegimiSQ
Ky gabim ndodh kur ndryshon një listë (shton ose heq) ndërsa e kalon me for-each. Zgjidhje: përdor Iterator.remove(), removeIf(), ose krijo një listë të re.
EnglishEN
This error happens when you change a list (add or remove) while looping over it with for-each. Fix: use Iterator.remove(), removeIf(), or build a new list.
Si ta mendosh
Si të heqësh karrige nga rreshti ndërsa po i numëron.
Lexoje në anglisht
Like removing chairs from a row while you're counting them.
Shembull kodijava
for (String e : emrat) if (e.isEmpty()) emrat.remove(e); // ✗
emrat.removeIf(String::isEmpty); // ✓