Question
a.
Both are able to access the object
b.
ConcurrentModificationException is thrown
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
Posted under Java Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. When two threads access the same ArrayList object what is the outcome of the program?
Similar Questions
Discover Related MCQs
Q. How is Arrays.asList() different than the standard way of initialising List?
View solution
Q. What is the difference between length() and size() of ArrayList?
View solution
Q. Which class provides thread safe implementation of List?
View solution
Q. Which of the below is not an implementation of List interface?
View solution
Q. What is the worst case complexity of accessing an element in ArrayList?
View solution
Q. When an array is passed to a method, will the content of the array undergo changes with the actions carried within the function?
View solution
Q. What is the default clone of HashSet?
View solution
Q. Do we have get(Object o) method in HashSet.
View solution
Q. What does Collections.emptySet() return?
View solution
Q. What are the initial capacity and load factor of HashSet?
View solution
Q. What is the relation between hashset and hashmap?
View solution
Q. Set has contains(Object o) method.
View solution
Q. What is the difference between TreeSet and SortedSet?
View solution
Q. What happens if two threads simultaneously modify TreeSet?
View solution
Q. What is the unique feature of LinkedHashSet?
View solution
Q. Which of these standard collection classes implements a linked list data structure?
View solution
Q. Which of these classes implements Set interface?
View solution
Q. Which of these method is used to add an element to the start of a LinkedList object?
View solution
Q. Which of these method of HashSet class is used to add elements to its object?
View solution
Q. Which of these methods can be used to delete the last element in a LinkedList object?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!