String The String class represents an immutable (unchangeable) sequence of Unicode (16-bit encoding) characters, appropriate for storing characters in any language (English, German, Japanese, and so on).
If you modify the contents of a String, a new String object is returned, such as to invoke replace(), toLowerCase().
Other Topics
String Literals (from: )
Literal strings within the same class in the same package represent references to the same String object.
Literal strings within different classes in the same package represent references to the same String object.
Literal strings within different classes in different packages likewise represent references to the same String object.
Strings computed by constant expressions are computed at compile time and then treated as if they were literals.
Strings computed by concatenation at run time are newly created and therefore distinct.
xxx
String and bytes When to create an instance of String from bytes, or get bytes from String, you can specify the coding type, or use the default one. General coding types include:
US-ASCII
ISO-8859-1
UTF-8
UTF-16BE
UTF-16LE
UTF-16
Compare Invoke String.equal to check if contents of two String objects are equal; Don't use 'str1 == str2', since it only check if str1 and str2 refer to the same String object.
xxx
StringBuffer It is mutable. This class is more effective than String if you need to change its contents frequently, since all changes only take place in inner buffer, and delay to create String object when it is necesssary.
And tis class is synchronized, that means the methods have synchronized modifier.
StringBuilder It it mutable as well. It is not synchronized, that means the methods have no synchronized modifier.
Formatter Formats arguments according to a format string. The format strings and specifiers are also defined in this class, such as %s, %d, %#x, etc.
Regular Expression
StringTokenizer Allow an application to break a string
into tokens by performing code point comparison.
Scanner A parser that parses a text string of primitive types and strings with the
help of regular expressions. The input is broken into tokens by the delimiter pattern, which is
whitespace by default.