O'Reilly logo

Beginning Java 8 Fundamentals: Language Syntax, Arrays, Data Types, Objects, and Regular Expressions by Kishori Sharan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 11

image

Strings

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

What is a String?

A sequence of zero or more characters is known as a string. In Java programs, a string is represented by an object of the java.lang.String class. The String class is immutable. That is, the contents of a String object cannot be modified after it has been created. The String class has two companion classes, java.lang.StringBuilder and java.lang.StringBuffer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required