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
8.6k 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
8.7k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.