when going through tutorials in web i found this line :
"The Collection classes that implement interface Set or Map
expect the object or key object respectively to override equals " I need some clarification on the above statement .
Please let me know if the above is true ,because as far as i am concerned i could easily add Objects to a HashSet
without my Object overriding equals or hashcode .
There should be explanations about collections working incorrectly in some of these links: Odersky, Spoon and Venners (courtesy of Garrett Rowe), Angelika Langer and Joshua Bloch's Effective Java™ (you may be able to find a "sample chapter" from the 1st edition on the internet, which describes equals()).