Skip to content

Instantly share code, notes, and snippets.

@MadinaB
Created January 6, 2019 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MadinaB/b8b62d6b86a216bf5c6d0162c0c6c5a9 to your computer and use it in GitHub Desktop.
Save MadinaB/b8b62d6b86a216bf5c6d0162c0c6c5a9 to your computer and use it in GitHub Desktop.
ConcurrentModificationException
import java.util.*;
public class MyClass {
public static void main(String args[]) {
LinkedList<Integer> list = new LinkedList<>();
list.addFirst(1);
Iterator key = list.listIterator(0);
list.add(1);
System.out.println(key.next());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment