📜  Java 如何复制字符串 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:14.387000             🧑  作者: Mango

代码示例1
Strings are immutable.
Which means you can easily copy a string using this method:

String string1 = "Original String";
String string2 = string1;
string1 = "New String";

and string2 will still be "Original String".