Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #35405
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: "equals" - a bad name? |
| Date | 2016-08-18 22:05 -0400 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <np5pho$kvq$1@gioia.aioe.org> (permalink) |
| References | <equals-20160814002020@ram.dialup.fu-berlin.de> <0oebrbd0tt47sk8k6u7l0inkhd5p3j76kd@4ax.com> <g9pbrbtqqe9brfkq8bqhlm6qll8fgi788l@4ax.com> |
On 8/18/2016 12:42 PM, Gene Wirchenko wrote: > On Thu, 18 Aug 2016 06:45:26 -0700, Roedy Green <inquiry@mindprod.com> > wrote: >> On 13 Aug 2016 23:25:20 GMT, ram@zedat.fu-berlin.de (Stefan Ram) >> wrote: >> >>> »a == b« and »a.equals( b )« have two different meanings >>> in Java. Fairly enough, they are written in different >>> ways in Java. >> >> Some Forth philosophy here. They pronounce words in a special way. >> They got into the habit since so many methods/operators contain >> punctuation. >> >> e.g. ! is pronounced "store". @ is pronounced "fetch" >> >> Some possible conventions: >> >> == very equals >> == equalsequals >> == same >> == identical > > In PHP, == is not identical; that would be ===. I got bit on > this on a uni assignment. PHP object1==object2 is Java object1.equals(object2), but the PHP class can not override the functionality it is always all fields PHP object1===object2 is Java object1==object2 PHP simple1===simple2 is Java simple1==simple2 PHP simple1==simple2 does not have a Java equivalent as PHP is doing various type conversions to see if it is logical the same Arne
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: "equals" - a bad name? Roedy Green <inquiry@mindprod.com> - 2016-08-18 06:45 -0700
Re: "equals" - a bad name? Gene Wirchenko <genew@telus.net> - 2016-08-18 09:42 -0700
Re: "equals" - a bad name? Arne Vajhøj <arne@vajhoej.dk> - 2016-08-18 22:05 -0400
csiph-web