+1 vote
in JAVA by
Why are strings immutable in Java?

1 Answer

0 votes
by

Why are strings immutable in Java?

Strings in java are frequently used for hashmap keys. Now if someone changes the value of the string it will cause severe discrepancies. Hence strings are made immutable.

Related questions

+2 votes
asked May 4, 2021 in JAVA by SakshiSharma
+1 vote
asked Mar 16, 2021 in JAVA by Robindeniel
...