© Kishori Sharan and Adam L. Davis 2022
K. Sharan, A. L. DavisBeginning Java 17 Fundamentalshttps://doi.org/10.1007/978-1-4842-7307-4_15

15. Strings

Kishori Sharan1   and Adam L. Davis2
(1)
Montgomery, AL, USA
(2)
Oviedo, FL, USA
 
In this chapter, you will learn:
  • What is a String object

  • How to create String objects

  • How to use String literals

  • How to manipulate Strings

  • How to use Strings in a switch statement or switch expression

  • How to use StringBuilder and StringBuffer objects to construct strings

  • How to create multiline strings

All classes in this chapter are members of a jdojo.string module, as declared in Listing 15-1.
// module-info.java
module jdojo.string {
    exports com.jdojo.string;
}
Listing 15-1

The Declaration of a jdojo.string Module

What Is a String? ...

Get Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 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.