A

Admin • 831.35K Points
Coach

Q. Which implementation would you choose for a Set where order matters and duplicates are not allowed?

  • (A) TreeSet
  • (B) LinkedHashSet
  • (C) HashSet
  • (D) EnumSet
  • Correct Answer - Option(B)
  • Views: 28
  • Filed under category Java
  • Hashtags: Java Set

Explanation by: Admin
LinkedHashSet maintains insertion order and ensures uniqueness.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.