for (Rectangle block:getBlock()) {
for (Rectangle done:getDone()){
if (block.y == done.y + 40) {
dones.add(block);
blocks.remove(block);
create();
}}
so im trying to get position y for every rectangle in the arraylists "blocks" and "dones" but i really dont know what happening when i run this code its like it works until if (block.y == done.y + 40)
this comes true and i got this Exception :
Exception in thread "LWJGL Application" java.util.ConcurrentModificationException
p.s. in the create method im adding Rectangle to blocks arraylist