Doubt in strings

what is intern pool???
what is the need of intern pool???
if we can store any string outside the intern pool then why we are using it ???

Hey @harsh.hj

String Pool in Java

Here is a diagram that clearly explains how String Pool is maintained in java heap space and what happens when we use different ways to create Strings.

String Pool in Java, string pool, java string pool
String pool helps in saving a lot of space for Java Runtime although it takes more time to create the String.