[5108] 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 (Mike Paluka)
Mon Jan 29 14:50:48 1996

Date: Mon, 29 Jan 1996 12:46:05 -0500
To: Pat Niemeyer <pat@icon-stl.net>
From: Mike Paluka <mikep@exmachina.com>
Cc: java-interest@java.sun.com

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?

From: Michael J. Paluka
At:   mikep@exmachina.com

-
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