The string data type is an important part of nearly every Java app. Prior to Java 9, string data was stored as an array of chars. This required 16 bits for each char. It was determined that the majority of string objects could be stored with only 8 bits, or 1 byte of storage. This is due to the fact that most strings consist of Latin-1 characters.
The Latin-1 characters refers to the Latin-1 character set established by the International Organization for Standardization. The character set consists of a single byte set of character's encodings.
Starting with Java 9, strings are now internally represented using a byte array, along with a flag field for encoding references.