First we use new to create a string object, such as:
String Str=new string ("123");
In this sentence, two objects were created, and the first one created a string "ABC" in the system;
Then in the creation of a Str object, and then in Let "123" of this string reference;
Creating a String object is equivalent to creating two.
Talk about why the string class is set to the final type.
The fianl type is a type that cannot be modified.
Imagine if I was right
Str=str.touppercase ();
Why does this need to be returned instead of being changed directly?
First, if the direct change may be manipulated to the system created by the ABC string, when the new ' ABC ' object, the system will no longer create an ABC object, but the newly created object directly to the ' ABC ' string
Failure to set the final type causes a direct operating system string that causes problems with the system string:
Why is the string class final