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