How to concurrently modify a Vector
问题 I have to ensure while iterating the Vector; there is no update on that Vector to avoid ConcurrentModificationException . I can use concurrent collection. But i just want to give a try on Vector. Below is the code I have written. public class TestConcurrentModification1 { Vector a = new Vector(); public static void main(String[] args) { final TestConcurrentModification1 obj = new TestConcurrentModification1(); new Thread(){ public void run(){ for(int i = 0; i < 5; i++){ try { Thread.sleep(1);