How do I stop concurrentmodificationexception?



How do I stop concurrentmodificationexception?..

Answer / Digniti Sharma

To avoid ConcurrentModificationException in Java, you can use collections that are thread-safe such as CopyOnWriteArrayList, Vector, or Hashtable. Another solution is to lock the collection while iterating over it using synchronization.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is an abstract class and abstract method?

5 Answers  


why an outer class cannot be declared as private?

2 Answers  


Describe the Big-O Notation.

1 Answers   Global Logic,


What is a classloader in java?

0 Answers  


what is mean by ooad? where we are using? can you tell me any real time example?

1 Answers   Eka Software,


What is Java Reflection API? Why it’s so important to have?

1 Answers  


Is it necessary for the port addresses to be unique? Explain with reason.

1 Answers   Aricent,


What is the difference in between cpp and java? Can u explain in detail?

1 Answers  


What is the difference between access specifiers and access modifiers in java?

1 Answers  


Which Math method is used to calculate the absolute value of a number?

3 Answers   Accenture,


Program to print 1 1 2 1 2 3 1 2 3 4 like that

8 Answers   Huawei,


These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }

1 Answers   HCL,


Categories