Tuesday, 25 March 2014

ConcurrentModificationException

http://way2java.com/exceptions/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).

public class IteratorDemo {
    public static void main(String args[]) {
        ArrayList al1 = new ArrayList();
        al1.add("Raju");
        al1.add("Reddy");
        al1.add("Rao");
        al1.add("Ratnakar");
        ListIterator it1 = al1.listIterator();
        while (it1.hasNext()) {
            System.out.print(it1.next()+" ");
            it1.add("Setty");
            //al1.add("Goud");
        }
    }
}
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). - See more at: http://way2java.com/exceptions/concurrentmodificationexception/#sthash.DD6Jznku.dpuf
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). - See more at: http://way2java.com/exceptions/concurrentmodificationexception/#sthash.DD6Jznku.dpuf
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). - See more at: http://way2java.com/exceptions/concurrentmodificationexception/#sthash.DD6Jznku.dpuf
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). - See more at: http://way2java.com/exceptions/concurrentmodificationexception/#sthash.DD6Jznku.dpuf
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). - See more at: http://way2java.com/exceptions/concurrentmodificationexception/#sthash.DD6Jznku.dpuf

No comments:

Post a Comment