Strings, which are widely used in Java programming, are a sequence of
characters. In the Java programming language, strings are objects.
Java platform provides the String class to create and manipulate
The most direct way to create a string is to
String greeting = "Hello world!";
In this case, "Hello world!"
is a string literal—a series of characters in your code that is enclosed in
double quotes. Whenever it encounters a string literal in your code, the
compiler creates a String object with its value—in this case, Hello world!.