Received: by 10.66.74.102 with SMTP id s6mr2370210pav.21.1346187493826; Tue, 28 Aug 2012 13:58:13 -0700 (PDT) Received: by 10.68.244.73 with SMTP id xe9mr2122047pbc.10.1346187493811; Tue, 28 Aug 2012 13:58:13 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!4no23665416pbn.1!news-out.google.com!t10ni106882016pbh.0!nntp.google.com!4no23665415pbn.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Tue, 28 Aug 2012 13:58:13 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T NNTP-Posting-Host: 69.28.149.29 References: <563f186a-edb3-4311-ae48-3af7decfce2c@googlegroups.com> <6ac6c252-c370-4f74-b29d-ce5368019977@googlegroups.com> <502598d0$0$287$14726298@news.sunsite.dk> <5028191b$0$290$14726298@news.sunsite.dk> <50317b03$0$281$14726298@news.sunsite.dk> <503bfd0f$0$282$14726298@news.sunsite.dk> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3cc7cc45-ae25-4d4e-936b-85dde7a17079@googlegroups.com> Subject: Re: hashCode From: Lew Injection-Date: Tue, 28 Aug 2012 20:58:13 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.java.programmer:18361 markspace wrote: > Patricia Shanahan wrote: >> markspace wrote: >> ... >>> For example, in C, one can always hash based on memory address. In Java >>> we don't have that option, so hashcode() takes the place of the >>> intrinsic property of an address. >> ... > >> In Java we have System.identityHashCode() which provides an address-like >> hash code for any object. > > I think System.identityHashCode() is the (same as the) default > implementation for Object::hashCode(), yes? Why wonder when it's in the Javadocs? Hm? It is, in fact, required to be. > So there's a small bit of evidence in support of the idea that > Object::hashCode() is meant to mimic the idea of just hashing on address.