Real objects use "equals" for equality

Try '==' and 'equals'
String are objects (not primitives).

Here we first compare using "==".
We next compare using "equals"
String s1, s2, template;
s1 = "moo";
s2 = "mooz".substring(0, 3);
prn("String1: " + s1);
prn("String2: " + s2);
template = "Using [%s] Result: %s%n";
prnf(template, "==", (s1 == s2));
prnf(template, "equals", (s1.equals(s2)));
The Surprising Result
The "==" operator tells us that "moo" is not equal to "moo".
The "equals" method tell us they are equal (we're not going crazy).

Trick: Generally use 'equals' for equality with the only exception being for prims.

Java actually helps us here becaue we can always try 'equals' and Java will tell us prims do onto support messages. Thus we flip to '=='.
String1: moo
String2: moo
Using [==] Result: false
Using [equals] Result: true