We know that Strings are immutable and if you want to change the original String value we have to use StringBuffer or StringBuilder class right?
But String class is final which make sense with immutability but why the StringBuffer and StringBuilder classes are also final?
Doesn't it have a impact on sting non immutability on those classes or it just make us not extend those classes?
It might be better to think of String and StringBuilder as two different ways to handle the same data. One is for storage of immutable data and the other for manipulation of data we want to change. But both store "writing".
We know that Strings are immutable and if you want to change the original String value we have to use...
Let me Quote my belief:
Strings are immutable and if you have the requirement to have an optimised approach towards using a
String with multiple operations of modifications being done on it, you would probably want to use a StringBuffer (or StringBuilder or MySomeWakyClassThatHandlesStringsWell)