Java Strings, StringBuilder and Text Blocks (OCP Java SE 25)
Manipulating text in Java means working with two classes: <code>String</code>, an immutable sequence of characters whose methods always return new values, and <code>StringBuilder</code>, a mutable buffer whose methods change it in place and return the same object. Objective 1.2 of the Java SE 25 Developer exam also covers text blocks, the multi-line String literals delimited by three double quotes. This lesson covers how each class behaves: string-pool identity, zero-based indexes and their exceptions, how <code>+</code> mixes numbers and text, the white-space, comparison, formatting and split methods, StringBuilder's index rules and equality, and exactly how the compiler turns a text block into a String.
You’ve read your 2 free 1Z0-831 lessons
Sign up free to read 48 more lessons — your progress is saved.
Source
This lesson covers the "Handling Date, Time, Text, Numeric and Boolean Values" domain of the official 1Z0-831 exam guide. Vendors revise their guides — check the source for the current version.
- Java SE 25 Developer Professional (1Z0-831) exam page and topics — Oracle University
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.