Originally posted by Deepak Bajoria: What is the effect of overrding equals method on Set.
I mean, Can a set have objects which are different but are "meaningfully" equal. The equals() has been correctly overridden i n the custom class to test the "meaningful equality"
Thanks in advance
Nope, javadoc says...
boolean add(E e)
Adds the specified element to this set if it is not already present (optional operation). More formally, adds the specified element e to this set if the set contains no element e2 such that (e==null ? e2==null : e.equals(e2)). If this set already contains the element, the call leaves the set unchanged and returns false.