Help getting experience
Isaac Sparrow
plug-discuss@lists.plug.phoenix.az.us
Fri, 21 Jun 2002 11:09:44 -0700
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday 21 June 2002 09:25 am, Alpha Zenon Sanchez wrote:
>
> BTW...my gut instinct tells me that the second example
>
> 'if (a.equals("something")){
>
> ---instructions----
>
> }
>
> will compile and work....I've seen this example
> before,
> but not sure why a.equals works rather than a ==
>
> =====
> Thanks,
> Alpha Zenon Sanchez
>
"a.equls()" tests to see if the objects are equal. Two diff. objects are
equal.
"==" will tell you if two refrences point to the same object.
String a = "foo"
String b = "foo"
if (a.equals(b)) // true
if (a == b) // false
b = a
if (a == b) // true
Hope this helps.
- --
- -------------------------------------------------
Isaac Sparrow
Staff Engineer
VisiComp, Inc.
http://www.visicomp.com
GnuPG Key Fingerprint:
1060 5A07 F6EC B2B3 9AAA 3EA5 7B79 EFE1 6397 4F47
Get my public key at:
http://www.concentric.net/~issparow
'Mounten' wird fuer drei Dinge benutzt: 'Aufsitzen' auf Pferde, 'einklinken'
von Festplatten in Dateisysteme, und, nun, 'besteigen' beim Sex.
(Christa Keil in a German posting: "Mounting is used for three things:
climbing on a horse, linking in a hard disk unit in data systems, and, well,
mounting during sex".)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: NSA bad. Encryption good.
iD8DBQE9E2vse3nv4WOXT0cRArERAJ446bZ0bYzp4rvP3abvhwgECo+PjACdGGmL
cY2XScj/BEnP6rGkL67HNng=
=lN7s
-----END PGP SIGNATURE-----