Vidyalelo
Java Programming · Q11

Java Collections Framework

Programming · Java Programming · question 11

Q11

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

A.
A `HashSet` uses a tree structure to store elements
B.
A `LinkedHashSet` is synchronized, while a `HashSet` is not
C.
A `LinkedHashSet` maintains insertion order, while a `HashSet` does not
Answer
D.
A `HashSet` allows duplicate elements, while a `LinkedHashSet` does not

Answer: Option C

Solution

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