A string object is Immutable. Why?
Answers
Answered by
0
Explanation:
The string is Immutable in Java because String objects are cached in the String pool. Since cached String literals are shared between multiple clients there is always a risk, where one client's action would affect all another client. ... Another reason why String class is immutable could die due to HashMap.
Answered by
0
Answer:
The string is Immutable in Java because String objects are cached in the String pool. Since cached String literals are shared between multiple clients there is always a risk, where one client's action would affect all another client. ... Another reason why String class is immutable could die due to HashMap
Similar questions