Dates and Strings
String class
Constructors
The String class
java.lang.String
A String object is immutable; its contents cannot be changed.
Common constructors of the String class
Constructor | Description |
---|---|
String() | Creates an empty string (""). |
String(arrayName) | Creates a string from an array of char or byte types. |
String(arrayName, intOffset, intLength) | Creates a string from a subset of an array of char or byte types. The characters referred to by intOffset and intLength must fall within the array, or the constructor will throw an exception. |