I'm getting a "An exception occurred: java.util.ConcurrentModificationException" when I run this piece of code. Does anyone here see what the problem is?
public void mudaDeEstado() {
Luz luz = new Luz();
while(this.iterador.hasNext()) {
luz = (this.iterador.next());
luz.defineEstado(!luz.acesa());
}
}
Thanks a lot!!