As I understand that
1) String s="abc"; creates "abc" in string pool and
2) String s=new String("abc").intern(); string pool reference is returned irrespective of whether "abc" exists in pool before or not.
My question is
What is the advantage of 1) over 2) (or vice versa) since both of these returns the reference from pool. Which syntax is preferred?
In 2) irrespective of "abc" present in pool, will the object gets created in heap initially and then its lost? (eligible for gc)