String 类中使用 final 关键字修饰字符数组来保存字符串, private final char value[] ,所以 String 对象是不可变的。 在 Java 9 之后, String 类的实现改⽤ byte 数组存储字符串 private final byte[] value