When Two Threads Access The Same Arraylist Object What Is The #685
When two threads access the same ArrayList object what is the outcome of the program?
This multiple choice question (MCQ) is related to the book/course gs gs128 Java. It can also be found in gs gs128 Java Util Collections Framework - Java List - Quiz No.1.
When two threads access the same ArrayList object what is the outcome of the program?
Both are able to access the object
ConcurrentModificationException is thrown
One thread is able to access the object and second thread gets Null Pointer exception
One thread is able to access the object and second thread will wait till control is passed to the second one