A

Admin • 828.43K Points
Coach

Q. How does HashSet handle duplicate elements internally?

  • (A) Throws an exception
  • (B) Replaces the old element
  • (C) Ignores the new element
  • (D) Ignores the old element
  • Correct Answer - Option(C)
  • Views: 13
  • Filed under category Java
  • Hashtags: Java Set

Explanation by: Admin
HashSet ignores the new element if it's a duplicate.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.