Help in String POOL in java

Hello Everyone,

I was just seeing an Example on String POOL in java Here and got stuck with doubt.

Java has a string pool, because of which objects of string class are unchanging.
However, my inquiry stands -

What was the need to make String POOL?

Why string class was not kept like other class to hold its own qualities?

Is inside JVM need a few strings or is this a presentation benefit? If yes how?

Hi Samir,

first of all I cannot see any webMethods specific in your question.

The original question should go to the JVM developers themselves, but this is a feature by design since the beginning of Java.

Regards,
Holger

2 Likes