Home » JAVA Programming » Data Structures » Question
  1. When two threads access the same ArrayList object what is the outcome of the program?
    1. One thread is able to access the object and second thread will wait till control is passed to the second one
    2. One thread is able to access the object and second thread gets Null Pointer exception
    3. Both are able to access the object
    4. ConcurrentModificationException is thrown
    5. None of these
Correct Option: D

ArrayList is not synchronized. Vector is the synchronized data structure.



Your comments will be displayed only after manual approval.