¥The String
class is built-in to Java, just like Object.
¥Finger Exercise: evaluate
ÐString
s = "Corky";
ÐObject
o = s;
Ðo
¥o
== s
¥String
t = "Cork" + "yÓ;
¥t
== s
¥s.length()
¥o
= null;
¥o.length()
¥Morals:
Ðmultiple copies of the same String
may exist; do not use == to test String equality.
ÐDo not use null to represent
legitimate data values.