Computer Science, asked by bhandprachi55, 1 month ago

A string object is Immutable. Why?​

Answers

Answered by Anonymous
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 user0172
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