Warum erhalte ich einen IllegalStateException?
Hallo
Wenn ich das mache, dann erhalte ich einen "Illegal State Exception".
bei it.remove() im Methodenkopf.
Warum geht das nicht?
1 Antwort
Nutzer, der sehr aktiv auf gutefrage ist
Weiß zwar nicht genau, wie du deinenen Schleifenkopf genau geschrieben hast, aber hier steht das, was du lesen solltest: https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html
IllegalStateException
- if the
next
method has not yet been called, or the
remove
method has already been called after the last call to the
next
method