Is “new String()” immutable as well?

后端 未结 15 2489
日久生厌
日久生厌 2020-12-12 23:43

I\'ve been studying Java String for a while. The following questions are based on the below posts

Java String is special
Immutability of String in java

15条回答
  •  一生所求
    2020-12-13 00:01

    String is immutable means that you cannot change the object itself no matter how you created it.And as for the second question: yes it will create an entry.

提交回复
热议问题