Any one can help me why set not allowed duplicate value in java.
Please post ur comment, its urgent.
Thanks in advance
1)Because set internally used Tree hierarchy that follows binary tree algorithm that's why it doesn't allow duplicate value. 2) It uses equals method for all object that we are storing in set.