编写一段代码来证明 Java 中的字符串是不可变的吗?

7 Jan 2025 | 1 分钟阅读

以下程序对此进行了演示。

文件:ProveStringImmutable .java

输出

Before Modification in st1
Both pointing to the same reference
After Modification
Both are pointing to different reference