Changing value of string

Suppose we initialize String s1=“Hello”; and then change s1 to s1=“Bye”; , then will “Hello” still be present in the intern pool even if no variable is pointing to it?

Hey @rishabhs70427_ac9bc1ed91d2a939 In java we have garbage collector which automatically deletes futile variables or data if they are not used for a particular time.So the string hello will be deleted by garbage collector after sometime automatically.