Why is it that they decided to make String
immutable in Java and .NET (and some other languages)? Why didn't they make it mutable?
Java – Why can’t strings be mutable in Java and .NET
javamutablenetstring
Related Topic
- Java – How to create a Java string from the contents of a file
- C# – Case insensitive ‘Contains(string)’
- .net – Difference between decimal, float and double in .NET
- Java – Does Java support default parameter values
- Php – the difference between single-quoted and double-quoted strings in PHP
- Java – Why is processing a sorted array faster than processing an unsorted array
- Java – Why does this code using random strings print “hello world”
- C# – Making a cross-thread call to a ListView
Best Answer
According to Effective Java, chapter 4, page 73, 2nd edition:
Other small points from the same chapter: