Originally posted by Steve Deadsea:
Strings are immutable to make String.substring() efficient. If they were not immutable, String.substring() would have to copy data because changing the original string might change the substring. As it is now, it can just point to a place within the string.
Strings are immutable not only for performance reasons (although as Karl pointed out manipulating immutable objects can have poor performance), but for security and
thread safety. If you have a few minutes at a bookstore, you might want to thumb through
Effective Java by Joshua Bloch. There is some great stuff in there about immutable objects.