Can we avoid interning of strings in java?

后端 未结 4 745
傲寒
傲寒 2020-12-20 01:51

Can we completely disable interning of strings. It might not be really helpful, but just a thought. I can think atleast one point where it could be helpful i.e. during jvm t

4条回答
  •  失恋的感觉
    2020-12-20 02:40

    String is a final class, and cannot be extended. Therefore, no - you cannot remove the ability to intern Strings in Java.

提交回复
热议问题