Vidyalelo
Java Programming · Q28

Java Collections Framework

Programming · Java Programming · question 28

Q28

What is the primary difference between a `HashSet` and a `LinkedHashSet` in the Java Collections Framework?

A.
A `LinkedHashSet` allows duplicate elements, while a `HashSet` does not
B.
A `LinkedHashSet` maintains the insertion order of elements, while a `HashSet` does not
Answer
C.
A `HashSet` allows duplicate elements, while a `LinkedHashSet` does not
D.
None of These

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board