String Immutable In Java

[Solved] String Immutable In Java | Scala - Code Explorer | yomemimo.com
Question : why string is immutable in java

Answered by : loveneesh-chopra

In the String constant pool, a String object is likely to have one or many references. If several references point to the same String without even knowing it, it would be bad if one of the references modified that String value. That's why String objects are immutable

Source : | Last Update : Tue, 18 Oct 22

Answers related to string immutable in java

Code Explorer Popular Question For Scala