but it seems as if "abc" is not shared here since "s1==s3" turns out to be false.
From reading the link, my understanding is that if a string is concatenated, it will create a new object. However, if you apply intern(), then it looks for pre-existing String object in memory for s3 to point to. The pre-existing object that s3 originally pointed to is now eligible for garbage collection:
Output:
false
true
After Intern Function on s3:
true