1.8 Strings
Introduction
`String` represents an immutable sequence of characters and is one of the most heavily used reference types in Java. "Immutable" means once a `String` object is created, its contents never change — every String method that appears to modify a string (like `toUpperCase()`) actually returns a brand-new `String`.
Key Concepts
Java Syntax
Code Examples
`length()` returns the character count. `toUpperCase()` returns a new uppercase String. `substring(0, 4)` extracts characters 0–3. `==` compares object references (false, since `new String(...)` forces a new object), while `.equals()` correctly compares content (true).