Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!53ab2750!not-for-mail From: "Roedy Green" Subject: Re: hashCode Message-ID: <50269FCD.56632.calajapr@time.synchro.net> X-Comment-To: bob smith Newsgroups: comp.lang.java.programmer In-Reply-To: <50254C53.56590.calajapr@time.synchro.net> References: <50254C53.56590.calajapr@time.synchro.net> X-FTN-AREA: COMP.LANG.JAVA.PROGRAMMER X-FTN-MSGID: 1:261/38 048293ea X-FTN-REPLY: 1:261/38 5ddc2510 Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.16a-Win32 NewsLink 1.98] Lines: 27 Date: Sat, 11 Aug 2012 18:17:49 GMT NNTP-Posting-Host: 69.21.70.65 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1344709069 69.21.70.65 (Sat, 11 Aug 2012 13:17:49 CDT) NNTP-Posting-Date: Sat, 11 Aug 2012 13:17:49 CDT Organization: tds.net Xref: csiph.com comp.lang.java.programmer:17685 To: bob smith From: Roedy Green On Fri, 10 Aug 2012 08:47:12 -0700 (PDT), bob smith wrote, quoted or indirectly quoted someone who said : > @Override > public int hashCode() { > return 1; > } that's about the worst possible hashCode function. See http://mindprod.com/jgloss/hashcode.html for tips on how to write good ones. -- Roedy Green Canadian Mind Products http://mindprod.com A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die, and a new generation grows up that is familiar with it. ~ Max Planck 1858-04-23 1947-10-04 --- BBBS/Li6 v4.10 Dada-1 * Origin: Prism bbs (1:261/38) --- Synchronet 3.16a-Win32 NewsLink 1.98 Time Warp of the Future BBS - telnet://time.synchro.net:24