SE450
:
Strings
[33/53]
substring
method yields substrings:
"Hello".substring(1, 3)
is
"el"
Use
equals
to compare strings
if (greeting.equals("Hello"))
==
only tests whether the object references are identical:
if ("Hello".substring(1, 3) == "el") ... // NO!