String 一旦被赋值,就不能改变 原理

/** * 字符串的特点:一旦被赋值,就不能改变。 */ public class StringNotChange { public static void main(String[] args) { String s = "hello"; s += "world"; System.out.println("s:" + s); // hell
相关文章
相关标签/搜索