3 ms·
> IIRC, Java String are immutable to allow creating substrings as views on the same char array, ... If you point to substring() as a view of a string, nope, th
by okr 12y ago
> IIRC, Java String are immutable to allow creating substrings as views on the same char array, ...
If you point to substring() as a view of a string, nope, that behaviour has changed for quite some time already. Surprisingly for me as well, back then.
- ffriend 12y agoAh, yeah, I remember discussion about this, but didn't know about its result (I'm not active Java developer for some time now). Anyway, I think you've got an idea - immutability assumption may be pretty useful and improve performance in some cases, not decrease it (if you use it correctly, of course).