为什么String是不可变的? [英] Why String is immutable?
本文介绍了为什么String是不可变的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们可以讨论一下吗? ;)
Can we have a discussion about it? ;)
推荐答案
你真的想讨论什么?
@ r035198x
为什么字符串不可变?我只是想知道原因?
@r035198x
Why String immutable ? i Just want to know the reason ?
如果它们是可变的,那么就没有String池实现,并且String池的性能提升会丢失。
If they were mutable then there would be no String pool implementation and the performance gains of the String pool become lost.
这篇关于为什么String是不可变的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文