1. Non-Change---execution efficiency is high
2. Because the object of string is basically used by all class objects, if it can be replicated, it will be very messy, such as the map key, if it is a string key, if the string can be changed, you think of the consequences
3. Implementation efficiency can be explained, object-oriented has a polymorphic nature, if it can be changed, can be replicated, sub-class if a method is replicated, the virtual function table is used, if the final type, the JVM directly to use, do not have to go to the virtual function table to find
----------as long as the declaration is final, the JVM does not need to query the related method in the virtual function table, but directly navigates to the related method of the string class, which improves the execution efficiency. base class to ensure that execution efficiency is the first element.
4. From the design idea to explain why this should be made final type
Language itself is a design. Any design idea is to abide by some established rules in order to embody
consistency . Both human language and machine language have their binding rules. Long, Double, Integer and so on, all final. The cornerstone of the program is immutable 5. It is also possible to interpret the definition from a security standpoint as final,6.string is widely used, to avoid the effects of polymorphism, or the functions he provides are already very rich, and you can extend a little more.
Interview question: Why is string in Java set to final