Section 14.3 Class String
• String objects are immutable (p. 599)—after they’re created, their character contents cannot be changed.
• String method length (p. 599) returns the number of characters in a String.
• String method charAt (p. 599) returns the character at a specific position.
• String method regionMatches (p. 601) compares portions of two strings for equality.
• String method equals tests for equality. The method returns true if the contents of the Strings are equal, false otherwise. Method equals uses a lexicographical comparison (p. 602) for Strings.
• When primitive-type values are compared with ==, the result is true if both values are identical. When references are compared with ==, the result is true if both refer to the same ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access