in Education by
Which class provides thread safe implementation of List? (a) ArrayList (b) CopyOnWriteArrayList (c) HashList (d) List This question was posed to me in an international level competition. I'm obligated to ask this question of Data Structures-List topic in section java.util – The Collections Framework of Java Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Correct choice is (b) CopyOnWriteArrayList The explanation: CopyOnWriteArrayList is a concurrent collection class. Its very efficient if ArrayList is mostly used for reading purpose because it allows multiple threads to read data without locking, which was not possible with synchronized ArrayList.

Related questions

0 votes
    PriorityQueue is thread safe. (a) True (b) False The question was asked during an interview. My question is ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of the below is not an implementation of List interface? (a) RoleUnresolvedList (b) Stack (c) AttibuteList ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Where does a new element be inserted in linked list implementation of a queue? (a) Head of list (b) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which class provides thread safe implementation of List? (a) ArrayList (b) CopyOnWriteArrayList (c) HashList ( ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these classes provide implementation of map interface? (a) ArrayList (b) HashMap (c) LinkedList (d) ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What are the use of front and rear pointers in CircularQueue implementation? (a) Front pointer points to first ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these standard collection classes implements a linked list data structure? (a) AbstractList (b) LinkedList ... of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these iterators can be used only with List? (a) Setiterator (b) ListIterator (c) Literator (d ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these standard collection classes implements all the standard functions on list data structure? (a) Array ... of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these methods sets every element of a List to a specified object? (a) set() (b) fill() ( ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these methods can randomize all elements in a list? (a) rand() (b) randomize() (c) shuffle( ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these methods can convert an object into a List? (a) SetList() (b) ConvertList() (c) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    How is Arrays.asList() different than the standard way of initialising List? (a) Both are same (b) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method of HashSet class is used to add elements to its object? (a) add() (b) Add() ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method Map class is used to obtain an element in the map having specified key? (a) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
...