Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Did the sort do anything? Date: Mon, 16 May 2011 17:32:16 -0400 Organization: albasani.net Lines: 34 Message-ID: References: <9303hcFq0nU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net Y+1k/oVLemeCdm/9dIrVghTE7kANT3yoqtoZOV/3abCh819ocCeuR5eTh9kXiXAn9001RFYRs3c3c+oK2zpjbRUaJZe2Hv7F5/TdrbVOCJUh1fRzZn80h0BTEKtUZSsd NNTP-Posting-Date: Mon, 16 May 2011 21:32:08 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="/hZhezlx+l97vukTjproVuLL0PUajMEiBXtTrhqbGtANvsPfSCuYKUTX7swBz4jBJCuY7TBfVeK+YYUqLfALZLPQ9RepVDbNe9NX7tMGdD9WFKLI/vQq1NfABArHUiRS"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 In-Reply-To: Cancel-Lock: sha1:WD9Ct9riHkYlN0uupCjfSWflhuA= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4175 Your attributions are messed up. You quote two people, but only attribute one. Lawrence D'Oliveiro wrote: > javax.swing.JSnarker wrote: >>> “Distinct” would presumably mean “not equal”. >> First, that applies to equals and hashCode and to == and >> identityHashCode, but not to equals and identityHashCode. > Which of those has to do with the concepts of “distinct” and “equal” as > ordinarily understood? First answer how these terms are "ordinarily understood", according to you. "Distinct" does not mean "not equal". "Distinct" means "not identical". "Equal" means "have the same value". Things can be distinct and equal, as Patricia has pointed out several times now. Java embodies this distinction by having both the operator == and the method 'equals()'. Distinct objects can be equal. For two references 'a' and 'b', both 'a != b' and 'a.equals( b )' can be true at once. So to answer your question, Laramie, 'equals()' applies to the concept of "equal" as ordinarily understood; '==' applies to "distinct" as ordinarily understood; 'hashCode()' applies to both "equal" and "distinct" as ordinarily understood; and 'System.identityHashCode()' has to do with "distinct" as ordinarily understood. Capisce? -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg