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.
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