String为什么是不可变的吗?简单来说就是String类利用了final修饰的char类型数组存储字符,源码如下图所以:/** The value is used for character storage. */ private final char value[];