Home » JAVA Programming » Collections » Question
  1. If two threads access the same hashmap at the same time, what would happen?
    1. RuntimeException
    2. ClassNotFoundException
    3. NullPointerException
    4. ConcurrentModificationException
    5. None of these
Correct Option: D

The code will throw ConcurrentModificationException if two threads access the same hashmap at the same time.



Your comments will be displayed only after manual approval.