183k views
0 votes
To store non-duplicated objects in the order in which they are inserted, use:______

a. HashSet
b. LinkedHashSet
c. TreeSet
d. ArrayList
e. LinkedList

User AliRezza
by
5.1k points

1 Answer

3 votes

Answer:

b. LinkedHashSet

Step-by-step explanation:

A LinkedHashSet is an ordered version of HashSet that maintains a doubly-linked List across all elements. When the iteration order is needed to be maintained this class is used. LinkedHashSet maintains a linked list of the entries in the set, in the order in which they were inserted.

User Rohanagarwal
by
5.2k points