What is meant by compatible equals() and hashCode() methods?
Location: http://www.jguru.com/faq/view.jsp?EID=302746 Created: Jan 15, 2001 Modified: 2001-01-15 08:08:21.172 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) In order for the Java Collections to work properly (and everything else in Java), the equals() and hashCode() methods must be compatible. Here, compatible means that if equals() reports that two instances are the same, then the hashCode() of both instances must be the same value.