Strings are immutable because it makes no sense to make them mutable. strings in real life are immutable:
is the word "mutable" the same as the word "camera", only with the letters changed, or is it a new, different word?
StringBuffer is mutable because otherwise it wouldn't work. you have to be able to add to it, and change it, by definition. that's what it's for
My theory on this is that Strings occupy fixed contiguous areas of memory. To alter them may corrupt the area of memory that comes immeadiately after a particular String. Therefore it is safe to not let programmers to alter them. A StringBuffer on the other hand overcomes this restriction and will allow expansion of itself by the programmer to other areas of memory, under control of the compiler, when required.
I wish people would stop thinking of StringBuffer and StringBuilder as special kinds of Strings
the answer is that all raw data is inherently immutable. you can't change the value of 2 to be 1, you can only use 1 instead of 2.
of course, there are ways to mutate a string instance.....