January 2018
Intermediate to advanced
115 pages
1h 37m
English
The String class in Java is a data type that can hold string literals. String is a reference data type, as are all non-primitive data types. This means that the variable contains an address to an object in the memory, and not the object itself. A String object is created in the memory, and the address to the object is returned to the variable.
As seen in the following code, string literals are delimited by double-quotes. This is shorthand notation for the regular reference type initialization (creation) syntax, which uses the new keyword: