Removing elements while Iterating over a Collection ?
Intent here is to check if you are aware of technique of modifying the collection structure while iterating over it. If we call collection.remove() from within the for loop then ConcurrentModificationException will be thrown by the JVM at runtime.
Read full article from Cracking Java Interviews (Core Java 8, Algorithm, Datastructure, Concurrency, Spring and Hibernate): Removing elements while Iterating over a Collection ?
No comments:
Post a Comment