A Java string is a sequence of characters that exist as an object of the class java.lang. Java strings are created and manipulated through the string class. Once created, a string is immutable -- its value cannot be changed.
methods of class String enable:
- Examining individual characters in the string.
- Comparing strings.
- Searching strings.
- Copying strings with characters converted from upper to lower case or vice versa.
Strings can be created simply. For example:
String greeting = "Hello world!";
"Hello world!" in that example is a string literal, defined by the double quotes, which means that the compiler will create an object with that value.
See a tutorial on creating and using strings in Java: