String POOL in java

后端 未结 4 1099
隐瞒了意图╮
隐瞒了意图╮ 2021-01-04 21:06

Java has string pool, due to which objects of string class are immutable.

But my question stands -

What was the need to make String POOL?

4条回答
  •  春和景丽
    2021-01-04 21:45

    Refer following links:

    Questions about Java's String pool

    Some queries regarding Java String Pool

    Regarding Java String Constant Pool

    and, you'll get your answer.

    In one sentence, the answer is to use JVM memory cleaverly

提交回复
热议问题