Chapter 8. Text and Core Utilities
If you’ve been reading this book sequentially, you’ve read all about the core Java language constructs, including the object-oriented aspects of the language. Now it’s time to shift gears and start talking about the collection of classes that compose the standard Java packages. Java’s core packages are one of its most distinguishing features. Many other object-oriented languages have similar features, but none has as extensive a set of standardized classes and tools as Java does. This is both a reflection of and a reason for Java’s success.
Strings
We’ll start by taking a closer look at the Java String class (or, more specifically, java.lang.String). Because working with strings is fundamental, it’s important to understand how they are implemented and what you can do with them.
A String object encapsulates a sequence of Unicode characters. Internally, these characters are stored in a regular Java array, but the String object guards this array jealously and ...
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