Doubt in String topic

What will happen to the hello object in intern pool if there will be no reference for it?

Hi @sanjaypanj940,
Garbage Collector in java collects all the object with no reference variable pointing to them and hence free them from memory . But if a string is interned then the object hello will not be garbage collected .
By the way you are pointing to the wrong video so i do not know what exactly are you taking about but i hope this information will help . However if there is further doubts please ask follow up questions.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.