In this chapter, you will learn:
What a String object is
How to create String objects
How to use String literals
How to manipulate Strings
How to use Strings in a switch statement
How to use StringBuilder and StringBuffer objects to work with mutable strings
All classes in this chapter are members of a jdojo.string module, as declared in Listing 15-1.
Listing 15-1. The Declaration of a jdojo.string Module
// module-info.java
module jdojo.string {
exports com.jdojo.string;
}
What Is a String?
A sequence of zero or more characters is known as a string. In Java programs, a string is represented ...