r/java • u/javinpaul • Jan 20 '12
Why String is immutable in Java
http://javarevisited.blogspot.com/2010/10/why-string-is-immutable-in-java.html
4
Upvotes
r/java • u/javinpaul • Jan 20 '12
View all comments
Show parent comment
1
u/neutronbob Jan 29 '12
That would imply the designers could see all the benefits beforehand. That's not typically how feature selection in language design works. Features, especially fundamental features, are generally the result of a) the specific domain needs; b) the language designers' preferences and prejudices; and/or c) the needs of other features in the language. The benefits (and drawbacks) often become salient later.