© Kishori Sharan 2017

Kishori Sharan, Beginning Java 9 Fundamentals, https://doi.org/10.1007/978-1-4842-2902-6_15

15. Strings

Kishori Sharan

(1)Montgomery, Alabama, USA

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.javamodule 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 ...

Get Beginning Java 9 Fundamentals: Arrays, Objects, Modules, JShell, and Regular Expressions 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.