4.1. Welcome to the world of the String class

[9.2] Create and manipulate strings

[3.2] Test equality between Strings and other objects using == and equals()

In this section, we’ll cover the class String defined in the Java API in the java.lang package. The String class represents character strings. We’ll create objects of the class String and work with its commonly used methods, including indexOf(), substring(), replace(), charAt(), and others. You’ll also learn how to determine the equality of two String objects.

The String class is perhaps the most-used class in the Java API. You’ll find instances of this class being used by every other class in the Java API. How many times do you think you’ve used the ...

Get OCA Java SE 8 Programmer I Certification Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.