r/java • u/fredoverflow • Jul 19 '26
Disregarding backwards compatibility, would it make sense for String to be a sealed class?
like public sealed class String permits Latin1String, Utf16String instead of the private final byte coder; field
20
Upvotes
View all comments
Show parent comment
1
u/Liskar-dev Jul 29 '26
It's 4 bytes, because Compressed OOPs is on by default