What is Immutable in String
I learn in the Sun java tutorial, there was something like this :
What does it mean by immutable? The contents of the string can easily be changed.
Note: The String class is immutable, so that once it is created a String object cannot be changed. The String class has a number of methods, some of which will be discussed below, that appear to modify strings. Since strings are immutable, what these methods really do is create and return a new string that contains the result of the operation.
newstrings = " What do you mean";
newstrings = " With that?";
What do you mean