Vidyalelo
Java Programming · Q176

Java Collections Framework

Programming · Java Programming · question 176

Q176

When two threads access the same ArrayList object what is the outcome of the program?

A.
Both are able to access the object
B.
ConcurrentModificationException is thrown
Answer
C.
One thread is able to access the object and second thread gets Null Pointer exception
D.
One thread is able to access the object and second thread will wait till control is passed to the second one

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board