As you may recall, a
String, which is widely used in Java, is an object that represents a sequence of characters. It is a great way to store information.
Because character strings are so vital to programming, Java dedicated an entire class to them. This is great news for us because the
String class has a lot of useful methods to help us perform operations on
Strings and data manipulation. We don’t have to import anything to use the
String class because it’s apart of the
java.lang package which is available by default.
In this lesson, we will go over several
Let’s get started!
Run the code in the code editor.
There are three string methods used in this program. We’ll learn about them later, but can you guess what some of them do?