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:
String literals are stored in the so-called String pool, maintained by the String class. For performance reasons, any string literal that is equal ...