Java中的String不可变是因为Java的设计者认为字符串使用非常频繁,将字 符串设置为不可变可以允许多个客户端之间共享相同的字符串。
安全4. The security aspect of having thestringclassimmutableinJavaisthat strings are usedforfile operations, memory management and network operations. If strings are allowed to be mutable, various properties could be changedinmalicious ways.4.在安全方面将String设计成不可变的原因就是String被用来进行文...