What is Concurrent Exception and explain with an example.

Showing Answers 1 - 6 of 6 Answers

g4java

  • Aug 20th, 2007
 

Concurrent Exception is the one which occurs while you try to do more than one operation on same property like it applies to collections in Java.

ex:

for (String s : set) {
set.add("String");
}

  Was this answer useful?  Yes

ConcurrentModificationException happens when you modify an object when you shouldn't. Most often, this happens when a collection is modified when you're iterating it.

Refer this site for more information

http://java.sun.com/j2se/1.4.2/docs/api/java/util/ConcurrentModificationException.html

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions