字符串池可以包含两个具有相同值的字符串吗?
String str = "abc";
String str1 = new String("abc");
Will the second statement with `new()` operator creates two objects of `string` "abc", one on `heap` and another on `string` pool?
Now if i call intern() on str1 ie str1.intern(); as a third statement, will str1 refer to the "abc" from String pool?
If yes then what will happen to the object that was created on heap earlier by the new(). Will that object be eligible for garbage collection.?
If no then what will be the result of str1.intern();?