Examveda

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

C. A `HashSet` allows duplicate elements, while a `LinkedHashSet` does not

D. None of These

Answer: Option B


This Question Belongs to Java Program >> Collections Framework In Java

Join The Discussion

Related Questions on Collections Framework in java