A

Admin • 802.91K Points
Coach

Q. What happens when we add duplicate elements in LinkedHashSet?

  • (A) They are stored in order
  • (B) They are added at the end
  • (C) Only first occurrence is stored
  • (D) An exception is thrown
  • Correct Answer - Option(C)
  • Views: 1
  • Filed under category Java
  • Hashtags: Java Set

Explanation by: Admin
LinkedHashSet ignores duplicates and keeps only the first occurrence.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.