I have this little piece of code and it gives me the concurrent modification exception. I cannot understand why I keep getting it, even though I do not see any concurrent mo
This didn't work:
LinkedList linkedList = new LinkedList();
ListIterator listIterator = linkedList.listIterator();
linkedList.add("aa");
linkedList.add("bb");
This worked:
LinkedList linkedList = new LinkedList();
linkedList.add("aa");
linkedList.add("bb");
ListIterator listIterator = linkedList.listIterator();