- Introduction to JVM Languages
- Vincent van der Leun
- 97字
- 2021-07-02 21:46:28
The String class (java.lang.String)
The java.lang.String class represents a JVM's String type. It is an immutable object, meaning that changes to the String object do not change the original object but produce a new string with the modified content. Strings are always stored internally in UTF-16 encoding.
This class will be covered in more detail in the next chapter. Some languages covered in this book have their own unique string classes that add convenient methods and other unique features to the language's string object. Usually, JVM languages transparently convert between the two string types under the hood.