Interview Q&A / Java
Java interview questions
Collections, the JVM, strings, exceptions and threads, the backbone of most campus placement rounds.
Prefer rapid revision? Practise Java short interview answers →
- What causes ConcurrentModificationException and how do you avoid it?
It is thrown when a collection is structurally modified while you iterate over it, for example calling list.remove() inside a for-each loop. Remove through the Iterator, use removeIf, or iterate over a copy.
BeginnerQuick answer1 min read