ConcurrentModificationException

As the name indicates, this exception is thrown when two objects are modifying a DS (like Vector or ArrayList) concurrently (at the same time when an operation, like iteration, is going on). Observe, the following code. import java.util.*; public class IteratorDemo { public static void main(String args[]) { ArrayList al1 = new ArrayList (); al1.add(“Raju”); …

ConcurrentModificationException Read More »