About Set in collections

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramadeviirrigireddy
    New Member
    • Jul 2007
    • 54

    About Set in collections

    Hi,

    How will a set know that there is a duplicate value existing ?
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by ramadeviirrigir eddy
    Hi,

    How will a set know that there is a duplicate value existing ?
    A set does not contain duplicate values. If you are asking how the implementation achieves this, then check the code (especially the add method) for the HashSet in the Java sources themselves.

    Comment

    • ramadeviirrigireddy
      New Member
      • Jul 2007
      • 54

      #3
      Originally posted by r035198x
      A set does not contain duplicate values. If you are asking how the implementation achieves this, then check the code (especially the add method) for the HashSet in the Java sources themselves.

      ok thanks for the reply.

      Comment

      Working...