
Why is String immutable in Java? - Stack Overflow
Mar 14, 2014 · The reasons for choosing immutable strings are outlined below, and the string pool is a working strategy because of that. Still, your answer is not incorrect, it just doesn't seem complete. …
java - String is immutable. What exactly is the meaning ... - Stack ...
Jan 10, 2012 · immutable in the sense of memory. It creates new objects every time you create strings or assign a new string/change the value. That's why it is advisable to be careful when using strings. …
Immutability of Strings in Java - Stack Overflow
String str = new String(); str = "Hello"; System.out.println(str); //Prints Hello str = "Help!"; System.out.println(str); //Prints Help! Now, in Java, Strings are immutable. Then how come the object …
java - What is meant by immutable? - Stack Overflow
Nov 11, 2008 · 423 What exactly does immutable mean - that is, what are the consequences of an object being mutable or immutable? In particular, why are Java's String s immutable? My …
Why are strings immutable in many programming languages?
Jun 8, 2014 · In Java not only String but all primitive Wrapper classes (Integer, Double, Character etc) are immutable. I am not sure of the exact reason but I think these are the basic data types on which …
Is a Java string really immutable? - Stack Overflow
Jan 6, 2014 · The implementation of String.substring(int, int) changed with Java 7u6. Before 7u6, the JVM would just keep a pointer to the original String 's char[] together with an index and length.
java - Why do we need immutable class? - Stack Overflow
Immutable classes are in general much simpler to design, implement and use correctly. An example is String: the implementation of java.lang.String is significantly simpler than that of std::string in C++, …
What's the advantage of a String being Immutable?
Aug 4, 2010 · Once I studied about the advantage of a string being immutable because of something to improve performace in memory. Can anybody explain this to me? I can't find it on the Internet.
Java Explain: why String immutable make StringBuffer MORE efficient
Mar 28, 2012 · 8 Because Strings are immutable, to manipulate Strings, such as to concatenate Strings, you have to create new String objects, since obviously, you can't change the state of existing String …
Why can't strings be mutable in Java and .NET? - Stack Overflow
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?