[5117] in java-interest

home help back first fref pref prev next nref lref last post

Re: Strings.substring() and the == operator

daemon@ATHENA.MIT.EDU (James Waldrop)
Mon Jan 29 16:47:45 1996

To: Mike Paluka <mikep@exmachina.com>
cc: Pat Niemeyer <pat@icon-stl.net>, java-interest@java.sun.com
In-reply-to: Your message of "Mon, 29 Jan 1996 12:46:05 EST."
             <199601291746.MAA07372@exmachina.com> 
Date: Mon, 29 Jan 1996 12:25:42 -0800
From: James Waldrop <sulam@construct.net>


Mike Paluka wrote:
>At 05:23 AM 1/28/96 -0600, you wrote:
>>
>>
>>On Sun, 28 Jan 1996, Walter Szewelanczyk wrote:
>>
>>"==" is a test for identity not for equality.  
>>You should always use equals() instead.
>>
>
>I'm glad you pointed this out.
>
>This is inconsistent and, in my opinion, a bad choice of behaviour
>for the equality operator (==) on strings.
>
>Will "intX == intY" return false if they refer to separate memory
>locations?  Of course not.
>
>Why did you do this to us, Arthur?

This is actually fairly typical behavior for strings in a lot of
different implementations.  There is nothing terribly controversial
about it...

James

--
James Waldrop                        /          Technical Director
sulam@construct.net              /              Construct Internet Design
sulam@well.com               /                  http://www.construct.net
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post